Commit 61ef56a1 authored by catea792's avatar catea792

update feature categories

parent 6c99a80b
<!-- eslint-disable vue/no-parsing-error -->
<template> <template>
<v-footer dark padless> <v-footer class="mt-12 flex-wrap" min-height="350px" dark padless>
<v-card flat tile class="indigo lighten-1 white--text text-center"> <v-row class="d-flex justify-space-between align-center">
<v-card-text> <v-col
<v-btn v-for="icon in icons" :key="icon" class="mx-4 white--text" icon> cols="12"
<v-icon size="24px"> md="3"
{{ icon }} >
</v-icon> <v-img
</v-btn> width="153px"
</v-card-text> src="https://d-themes.com/html/riode/images/logo-footer.png"
/>
<v-card-text class="white--text pt-0"> </v-col>
Phasellus feugiat arcu sapien, et iaculis ipsum elementum sit amet. <div class="flex-column">
Mauris cursus commodo interdum. Praesent ut risus eget metus luctus <h3>Subscribe to our Newsletter</h3>
accumsan id ultrices nunc. Sed at orci sed massa consectetur dignissim a <h4>Get all the latest information, Sales and Offers.</h4>
sit amet dui. Duis commodo vitae velit et faucibus. Morbi vehicula
lacinia malesuada. Nulla placerat augue vel ipsum ultrices, cursus
iaculis dui sollicitudin. Vestibulum eu ipsum vel diam elementum tempor
vel ut orci. Orci varius natoque penatibus et magnis dis parturient
montes, nascetur ridiculus mus.
</v-card-text>
<v-divider />
<div class="footer-bottom">
<div class="footer-bottom-left">
<figure class="payment">
<img
src="~/assets/images/payment.png"
alt="payment"
width="159"
height="29"
>
</figure>
</div>
<p class="copyright">
Riode eCommerce © 2022. All Rights Reserved
</p>
<div class="footer-bottom-right">
<div class="social-link">
<v-btn
v-for="icon in icons"
:key="icon"
class="mx-4 white--text"
icon
>
<v-icon size="24px">
{{ icon }}
</v-icon>
</v-btn>
</div>
</div>
</div> </div>
</v-card> <v-col
cols="12"
md="4"
>
<v-text-field label="email address here ..."></v-text-field>
</v-col>
<v-btn color="primary">SUBSCRIBE</v-btn>
</v-row>
<v-divider></v-divider>
</v-footer> </v-footer>
</template> </template>
<script> <script>
export default { export default {
name: 'FooterBar',
data: () => ({ data: () => ({
icons: ['mdi-facebook', 'mdi-twitter', 'mdi-linkedin', 'mdi-instagram'] icons: ['mdi-facebook', 'mdi-twitter', 'mdi-linkedin', 'mdi-instagram'],
img: 'https://d-themes.com/html/riode/images/logo-footer.png'
}) })
} }
</script> </script>
<style> <style></style>
.footer-bottom-left {
position: absolute;
left: 0;
}
.footer-bottom-right {
position: absolute;
right: 0;
}
.copyright {
position: absolute;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
}
</style>
This diff is collapsed.
<template> <template>
<v-container> <v-container>
<div class="navbar d-flex justify-space-between col-md-7"> <div class="navbar d-flex justify-space-between ">
<div> <div class="d-flex justify-space-between col-md-7">
<span> <div>
Home <span>
</span> Home
</div> </span>
<div class="dropdown"> </div>
<span> <div class="dropdown">
Products <span>
</span> Products
<v-icon>mdi-chevron-down</v-icon> </span>
<div class="dropdown-content elevation-10" :elevation="2"> <v-icon>mdi-chevron-down</v-icon>
<v-treeview <div class="dropdown-content elevation-10" :elevation="2">
:active.sync="active" <v-treeview
rounded :active.sync="active"
dense rounded
hoverable dense
activatable hoverable
:items="categories" activatable
/> :items="categories"
@update:active="setCategory(item)"
>
<template #label="{ item }">
<nuxt-link :to="`/home-page/categories/${item.id}`" tag="div">
{{ item.name }}
</nuxt-link>
</template>
</v-treeview>
</div>
</div>
<div>
<span>
Pages
</span>
</div>
<div>
<span>
Blogs
</span>
</div>
<div>
<span>
About
</span>
</div> </div>
</div> </div>
<div> <div class="d-flex align-center ">
<span> <v-icon>mdi-tag</v-icon>
Pages <span class="mx-2">
</span> Special offer!
</div>
<div>
<span>
Blogs
</span> </span>
</div> <span class="mx-2">
<div> Buy riode
<span>
About
</span> </span>
</div> </div>
</div> </div>
...@@ -42,6 +60,8 @@ ...@@ -42,6 +60,8 @@
</template> </template>
<script> <script>
import { mapActions, mapState } from 'vuex'
export default { export default {
name: 'NavBar', name: 'NavBar',
data: () => ({ data: () => ({
...@@ -51,11 +71,14 @@ export default { ...@@ -51,11 +71,14 @@ export default {
}), }),
computed: { computed: {
...mapState(['selectedCategory']),
...mapActions(['setSelectedCategory']),
selected () { selected () {
if (!this.active.length) { return undefined } if (!this.active.length) { return undefined }
const id = this.active[0] const id = this.active[0]
console.log(id) console.log(id)
return this.categories.find(category => category.id === id) // console.log(this.categories.find(category => category.id === id).name)
return this.categories.find(category => category.id === id) || ''
} }
}, },
...@@ -63,11 +86,10 @@ export default { ...@@ -63,11 +86,10 @@ export default {
selected () { selected () {
if (!this.active.length) { return undefined } if (!this.active.length) { return undefined }
const id = this.active[0] const id = this.active[0]
return id return id || ''
} }
}, },
beforeCreate () {
created () {
this.$axios this.$axios
.get('guest/categories/index') .get('guest/categories/index')
.then((response) => { .then((response) => {
...@@ -77,8 +99,13 @@ export default { ...@@ -77,8 +99,13 @@ export default {
console.log(error) console.log(error)
}) })
}, },
mounted () {
},
methods: { methods: {
setCategory () {
console.log(this.selected)
this.$store.commit('category/setCurrentCategory', this.selected.name || '')
}
} }
} }
</script> </script>
......
<template> <template>
<v-app> <v-app>
<UserHeader /> <UserHeader ref="child" />
<Nuxt /> <Nuxt />
<FooterBar />
</v-app> </v-app>
</template> </template>
<script> <script>
import Header from '@/components/user/Header' import Header from '@/components/user/Header'
import FooterBar from '@/components/FooterBar'
export default { export default {
component: { component: {
Header Header,
FooterBar
}, },
components: { FooterBar },
created () { created () {
this.changeColor() this.changeColor()
}, },
...@@ -25,5 +29,7 @@ export default { ...@@ -25,5 +29,7 @@ export default {
</script> </script>
<style> <style>
body{
font-family: monospace;
}
</style> </style>
...@@ -29,7 +29,8 @@ export default { ...@@ -29,7 +29,8 @@ export default {
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [ plugins: [
'~/plugins/axios.js', '~/plugins/axios.js',
'~/plugins/formatTime.js' '~/plugins/formatTime.js',
'~/plugins/eventBus.js'
], ],
// Auto import components: https://go.nuxtjs.dev/config-components // Auto import components: https://go.nuxtjs.dev/config-components
......
<template> <template>
<div> <div>
<div> <div>
<h1 style="text-align: center">ABOUT</h1> <h1 style="text-align: center">
</div> ABOUT
</h1>
</div>
</div> </div>
</template> </template>
\ No newline at end of file
...@@ -120,6 +120,7 @@ export default { ...@@ -120,6 +120,7 @@ export default {
localStorage.setItem('token', resp.data.data.bearer_token) localStorage.setItem('token', resp.data.data.bearer_token)
this.$auth.$storage.setUniversal('token', resp.data.data.bearer_token) this.$auth.$storage.setUniversal('token', resp.data.data.bearer_token)
this.$auth.$storage.setUniversal('userName', resp.data.data.name) this.$auth.$storage.setUniversal('userName', resp.data.data.name)
this.$auth.$storage.setUniversal('ID', resp.data.data.id)
this.$auth.$storage.setUniversal('loggedIn', 'true') this.$auth.$storage.setUniversal('loggedIn', 'true')
if (resp.status === 200) { if (resp.status === 200) {
this.$toast.success('Successfully authenticated', { this.$toast.success('Successfully authenticated', {
......
import Vue from 'vue' import Vue from 'vue'
import Vuex from 'vuex' import Vuex from 'vuex'
Vue.use(Vuex) Vue.use(Vuex)
export const store = new Vuex.Store({ export const state = () => ({
modules: { products: []
}
}) })
export const mutations = {
setProducts (state, products) {
state.products = products
},
addProduct (state, product) {
state.products.push(product)
}
}
export const actions = {
async fetchProducts ({ commit }) {
// Lấy dữ liệu sản phẩm từ API
const products = await fetch('https://example.com/products')
.then(response => response.json())
.then(data => data)
// Lưu dữ liệu sản phẩm vào store Vuex
commit('setProducts', products)
}
}
export const getters = {
getProductById: state => (id) => {
return state.products.find(product => product.id === id)
}
}
export const strict = false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment