Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
K
kiaisoft_tuananh_nuxt
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TTS Tran Viet Anh
kiaisoft_tuananh_nuxt
Commits
61ef56a1
Commit
61ef56a1
authored
Mar 15, 2023
by
catea792
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update feature categories
parent
6c99a80b
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
522 additions
and
376 deletions
+522
-376
FooterBar.vue
components/FooterBar.vue
+28
-72
Header.vue
components/user/Header.vue
+380
-256
NavBar.vue
components/user/NavBar.vue
+64
-37
user.vue
layouts/user.vue
+9
-3
nuxt.config.js
nuxt.config.js
+2
-1
about.vue
pages/about.vue
+6
-4
login.vue
pages/login.vue
+1
-0
index.js
store/index.js
+32
-3
No files found.
components/FooterBar.vue
View file @
61ef56a1
<!-- 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
>
components/user/Header.vue
View file @
61ef56a1
...
@@ -3,120 +3,73 @@
...
@@ -3,120 +3,73 @@
<div>
<div>
<!-- header top -->
<!-- header top -->
<div
class=
"header-top"
>
<div
class=
"header-top"
>
<v-container>
<v-container
class=
"pa-0"
>
<v-row
no-gutters
>
<v-row
no-gutters
>
<v-col
<v-col
cols=
"12"
sm=
"8"
class=
"header-top-left"
>
cols=
"12"
<span>
Hello message
</span>
sm=
"6"
>
<v-list-item-content>
<v-list-item-title>
Hello message
</v-list-item-title>
</v-list-item-content>
</v-col>
</v-col>
<v-col
<v-col
cols=
"12"
sm=
"4"
class=
"header-top-right"
>
cols=
"12"
<div
class=
"dropdown"
>
sm=
"6"
<span>
USD
</span>
class=
"d-flex"
<v-icon
small
>
>
mdi-chevron-down
<div
class=
"text-center"
>
</v-icon>
<v-menu
<div
class=
"dropdown-content"
>
open-on-hover
<div
offset-y
v-for=
"(item, i) in currency"
>
:key=
"i"
<template
#activator
="
{ on, attrs }">
class=
"dropdown-item"
<v-btn
plain
v-bind=
"attrs"
v-on=
"on"
>
<span>
USD
</span>
<v-icon>
mdi-chevron-down
</v-icon>
</v-btn>
</
template
>
<v-list
dense
>
>
<v-list-item>
<span>
<v-btn
plain
>
{{
item
.
text
}}
USD
</span>
</v-btn>
</div>
</v-list-item>
</div>
<v-list-item>
<v-btn
plain
>
EUR
</v-btn>
</v-list-item>
</v-list>
</v-menu>
</div>
</div>
<div
class=
"text-center"
>
<div
class=
"dropdown"
>
<v-menu
<span>
ENG
</span>
open-on-hover
<v-icon
small
>
offset-y
mdi-chevron-down
>
</v-icon>
<
template
#activator
="{
on
,
attrs
}"
>
<div
class=
"dropdown-content"
>
<v-btn
<div
plain
v-for=
"(item, i) in languages"
v-bind=
"attrs"
:key=
"i"
v-on=
"on"
class=
"dropdown-item"
>
<span>
Eng
</span>
<v-icon>
mdi-chevron-down
</v-icon>
</v-btn>
</
template
>
<v-list
dense
>
>
<v-list-item>
<span>
<v-btn
plain
>
{{
item
.
text
}}
Eng
</span>
</v-btn>
</div>
</v-list-item>
</div>
<v-list-item>
<v-btn
plain
>
FRH
</v-btn>
</v-list-item>
</v-list>
</v-menu>
</div>
</div>
<v-divider
vertical
/>
<v-divider
vertical
/>
<v-btn
<div
class=
"header-info"
>
plain
<v-icon
small
>
v-bind=
"attrs"
mdi-map-marker-outline
v-on=
"on"
</v-icon>
>
<v-icon>
mdi-map-marker-outline
</v-icon>
<span>
Contact
</span>
<span>
Contact
</span>
</v-btn>
</div>
<v-btn
<div
class=
"header-info"
>
plain
<v-icon
small
>
v-bind=
"attrs"
mdi-alert-circle-outline
v-on=
"on"
</v-icon>
>
<v-icon>
mdi-alert-circle-outline
</v-icon>
<span>
Need help
</span>
<span>
Need help
</span>
</v-btn>
</div>
<v-btn
<div
class=
"authentication"
>
plain
<div
class=
"header-info"
@
click=
"openDialogLogin"
>
v-bind=
"attrs"
<v-icon
small
>
v-on=
"on"
mdi-account-outline
@
click=
"openDialogLogin"
</v-icon>
>
<span>
Login
</span>
<v-icon>
mdi-account-outline
</v-icon>
</div>
<span>
login
</span>
<v-icon
small
>
</v-btn>
mdi-slash-forward
<v-icon>
mdi-slash-forward
</v-icon>
</v-icon>
<v-btn
<div
class=
"header-info"
@
click=
"openDialogSignUp"
>
plain
<span>
Signup
</span>
v-bind=
"attrs"
</div>
v-on=
"on"
</div>
@
click=
"openDialogSignUp"
>
<span>
Signup
</span>
</v-btn>
</v-col>
</v-col>
</v-row>
</v-row>
</v-container>
</v-container>
...
@@ -125,77 +78,54 @@
...
@@ -125,77 +78,54 @@
<!-- header middle -->
<!-- header middle -->
<div
class=
"header-middle d-flex"
>
<div
class=
"header-middle d-flex"
>
<v-container
py-5
d-flex
>
<v-container
class=
"header-middle-content"
py-7
>
<v-col
<v-col
cols=
"12"
md=
"8"
class=
"header-middle-left padding-0"
>
cols=
"12"
<div
class=
"logo"
>
md=
"3"
<v-img
>
width=
"153px"
<v-img
src=
"https://d-themes.com/html/riode/images/logo.png"
width=
"153px"
/>
src=
"https://d-themes.com/html/riode/images/logo.png"
</div>
/>
<v-form
class=
"d-flex form-search"
>
</v-col>
<v-col
cols=
"12"
md=
"5"
>
<v-form
ref=
"form"
class=
"d-flex"
>
<v-text-field
<v-text-field
outlined
dense
hide-details=
"auto"
label=
"Search"
label=
"Search"
variant=
"outlined
"
class=
"search-input
"
/>
/>
<v-btn
<span
class=
"icon"
>
icon
<v-icon>
mdi-magnify
</v-icon>
>
</span>
<v-icon>
mdi-magnify
</v-icon>
</v-btn>
</v-form>
</v-form>
</v-col>
</v-col>
<v-col
<v-col
cols=
"12"
md=
"4"
class=
"header-middle-right padding-0"
>
cols=
"12"
<div
class=
"hotline d-flex"
>
md=
"4"
class=
"d-flex"
>
<v-btn
plain
v-bind=
"attrs"
v-on=
"on"
>
<v-icon
large
>
<v-icon
large
>
mdi-phone
mdi-phone
-outline
</v-icon>
</v-icon>
<span>
Call us now:
<div
class=
"contact"
>
<b>
0123456789
</b>
<span>
Call us now:
</span>
</span>
<b>
0(800) 123-456
</b>
</v-btn>
</div>
</div>
<v-divider
vertical
inset
/>
<v-divider
vertical
inset
/>
<v-btn
<div
class=
"wish-list"
v-bind=
"attrs"
v-on=
"on"
@
click.stop=
"drawer = true"
>
plain
v-bind=
"attrs"
v-on=
"on"
@
click.stop=
"drawer = true"
>
<v-icon
large
>
<v-icon
large
>
mdi-heart-outline
mdi-heart-outline
</v-icon>
</v-icon>
</
v-btn
>
</
div
>
<v-divider
vertical
inset
/>
<v-divider
vertical
inset
/>
<v-btn
<div
id=
"menu-activator"
class=
"cart"
plain
v-bind=
"attrs"
v-on=
"on"
>
id=
"menu-activator"
<span>
Shopping cart:
plain
v-bind=
"attrs"
v-on=
"on"
>
<v-spacer
/>
<span>
Cart:
<b>
$:0.00
</b>
<b>
$:0.00
</b>
</span>
</span>
<v-badge
:content=
"15"
floating
>
<v-badge
:content=
"products.length || 0"
floating
bordered
overlap
>
<v-icon
large
>
<v-icon
large
>
mdi-cart-outline
mdi-cart-outline
</v-icon>
</v-icon>
...
@@ -203,20 +133,20 @@
...
@@ -203,20 +133,20 @@
<v-menu
activator=
"#menu-activator"
style=
"width: 300px"
>
<v-menu
activator=
"#menu-activator"
style=
"width: 300px"
>
<v-list
dense
three-line
>
<v-list
dense
three-line
>
<v-list-item
<v-list-item
v-for=
"item in
item
s"
v-for=
"item in
product
s"
:key=
"item.
title
"
:key=
"item.
id
"
link
link
>
>
<v-list-item-avatar>
<v-list-item-avatar>
<v-img
:src=
"item.pr
ependAvatar
"
/>
<v-img
:src=
"item.pr
oduct.images[0]
"
/>
</v-list-item-avatar>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-content>
<v-list-item-title>
{{ item.
titl
e }}
</v-list-item-title>
<v-list-item-title>
{{
item
.
product
.
nam
e
}}
</v-list-item-title>
<v-list-item-subtitle>
{{ item.
subtitl
e }}
</v-list-item-subtitle>
<v-list-item-subtitle>
{{
item
.
quantity
+
"
x
"
+
item
.
product
.
pric
e
}}
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item-content>
<v-list-item-action>
<v-list-item-action>
<v-btn
icon
@
click=
"remove
(
index)"
>
<v-btn
icon
@
click=
"remove
Cart(item,
index)"
>
<v-icon
color=
"grey lighten-1"
>
<v-icon
color=
"grey lighten-1"
>
mdi-close-circle-outline
mdi-close-circle-outline
</v-icon>
</v-icon>
...
@@ -227,18 +157,18 @@
...
@@ -227,18 +157,18 @@
<v-divider
/>
<v-divider
/>
<div
class=
"d-flex justify-space-between align-center ma-4"
>
<div
class=
"d-flex justify-space-between align-center ma-4"
>
<span>
Subtotal:
</span>
<span>
Subtotal:
</span>
<span>
139$
</span>
<span>
{{
total
+
"
$
"
}}
</span>
</div>
</div>
<v-divider
/>
<v-divider
/>
<v-btn
<v-btn
size=
"x-large"
size=
"x-large"
color=
"primary"
color=
"primary"
class=
"d-flex mt-4
align-center mx-auto"
class=
"d-flex mt-4 align-center mx-auto"
>
>
GO TO CHECKOUT
GO TO CHECKOUT
</v-btn>
</v-btn>
</v-menu>
</v-menu>
</
v-btn
>
</
div
>
</v-col>
</v-col>
</v-container>
</v-container>
</div>
</div>
...
@@ -250,8 +180,8 @@
...
@@ -250,8 +180,8 @@
<!-- end header bottom -->
<!-- end header bottom -->
<!-- show modal -->
<!-- show modal -->
<LoginModal
:status=
"activeLogin"
@
close=
"activeLogin
=
false"
/>
<LoginModal
:status=
"activeLogin"
@
close=
"activeLogin
=
false"
/>
<SignupModal
:status=
"activeRegister"
@
close=
"activeRegister
=
false"
/>
<SignupModal
:status=
"activeRegister"
@
close=
"activeRegister
=
false"
/>
<!-- show drawer -->
<!-- show drawer -->
<v-navigation-drawer
<v-navigation-drawer
v-model=
"drawer"
v-model=
"drawer"
...
@@ -262,35 +192,26 @@
...
@@ -262,35 +192,26 @@
>
>
<div
class=
"d-flex justify-space-between drawer_header"
>
<div
class=
"d-flex justify-space-between drawer_header"
>
<b>
WISHLIST
</b>
<b>
WISHLIST
</b>
<v-btn
<v-btn
plain
@
click.stop=
"drawer = !drawer"
>
plain
@
click.stop=
"drawer = !drawer"
>
Close
Close
<v-icon>
<v-icon>
mdi-arrow-right-thin
</v-icon>
mdi-arrow-right-thin
</v-icon>
</v-btn>
</v-btn>
</div>
</div>
<v-divider
/>
<v-divider
/>
<v-list
dense
three-line
>
<v-list
dense
three-line
>
<v-list-item
<v-list-item
v-for=
"item in wishlist"
:key=
"item.name"
link
>
v-for=
"item in items"
:key=
"item.title"
link
>
<v-list-item-avatar>
<v-list-item-avatar>
<v-img
:src=
"item.pr
ependAvatar
"
/>
<v-img
:src=
"item.pr
oduct.images[0]
"
/>
</v-list-item-avatar>
</v-list-item-avatar>
<v-list-item-content>
<v-list-item-content>
<v-list-item-title>
{{ item.
titl
e }}
</v-list-item-title>
<v-list-item-title>
{{
item
.
product
.
nam
e
}}
</v-list-item-title>
<v-list-item-subtitle>
{{ item.
subtitl
e }}
</v-list-item-subtitle>
<v-list-item-subtitle>
{{
item
.
product
.
pric
e
}}
</v-list-item-subtitle>
</v-list-item-content>
</v-list-item-content>
<v-list-item-action>
<v-list-item-action>
<v-btn
icon
@
click=
"remove
(
index)"
>
<v-btn
icon
@
click=
"remove
Wishlist(item,
index)"
>
<v-icon
color=
"grey lighten-1"
>
<v-icon
color=
"grey lighten-1"
>
mdi-close-circle-outline
mdi-close-circle-outline
</v-icon>
</v-icon>
...
@@ -306,6 +227,7 @@
...
@@ -306,6 +227,7 @@
import
LoginModal
from
'
~/components/LoginModal.vue
'
import
LoginModal
from
'
~/components/LoginModal.vue
'
import
SignupModal
from
'
~/components/RegisterModal.vue
'
import
SignupModal
from
'
~/components/RegisterModal.vue
'
import
NavBar
from
'
~/components/user/NavBar
'
import
NavBar
from
'
~/components/user/NavBar
'
import
{
eventBus
}
from
'
~/plugins/eventBus.js
'
export
default
{
export
default
{
name
:
'
UserHeader
'
,
name
:
'
UserHeader
'
,
...
@@ -314,40 +236,39 @@ export default {
...
@@ -314,40 +236,39 @@ export default {
SignupModal
,
SignupModal
,
NavBar
NavBar
},
},
data
:
()
=>
{
data
:
()
=>
{
return
{
return
{
products
:
[],
wishlist
:
[],
activeLogin
:
false
,
activeLogin
:
false
,
activeRegister
:
false
,
activeRegister
:
false
,
drawer
:
false
,
drawer
:
false
,
items
:
[
currency
:
[
{
{
text
:
'
USD
'
,
icon
:
'
mdi-clock
'
},
prependAvatar
:
'
https://cdn.vuetifyjs.com/images/lists/1.jpg
'
,
{
text
:
'
EUR
'
,
icon
:
'
mdi-account
'
}
title
:
'
Brunch this weekend?
'
,
],
subtitle
:
'
<span class="text-primary">Ali Connors</span> — I
\'
ll be in your neighborhood doing errands this weekend. Do you want to hang out?
'
languages
:
[
},
{
text
:
'
ENG
'
,
icon
:
'
mdi-clock
'
},
{
{
text
:
'
FRH
'
,
icon
:
'
mdi-account
'
}
prependAvatar
:
'
https://cdn.vuetifyjs.com/images/lists/2.jpg
'
,
title
:
'
Summer BBQ
'
,
subtitle
:
'
<span class="text-primary">to Alex, Scott, Jennifer</span> — Wish I could come, but I
\'
m out of town this weekend.
'
},
{
prependAvatar
:
'
https://cdn.vuetifyjs.com/images/lists/3.jpg
'
,
title
:
'
Oui oui
'
,
subtitle
:
'
<span class="text-primary">Sandra Adams</span> — Do you have Paris recommendations? Have you ever been?
'
},
{
prependAvatar
:
'
https://cdn.vuetifyjs.com/images/lists/4.jpg
'
,
title
:
'
Birthday gift
'
,
subtitle
:
'
<span class="text-primary">Trevor Hansen</span> — Have any ideas about what we should get Heidi for her birthday?
'
},
{
prependAvatar
:
'
https://cdn.vuetifyjs.com/images/lists/5.jpg
'
,
title
:
'
Recipe to try
'
,
subtitle
:
'
<span class="text-primary">Britta Holt</span> — We should eat this: Grate, Squash, Corn, and tomatillo Tacos.
'
}
]
]
}
}
},
},
computed
:
{
total
()
{
const
arr
=
[]
this
.
products
.
map
((
value
)
=>
{
return
arr
?.
push
(
value
.
price
)
})
return
arr
.
reduce
((
acc
,
cur
)
=>
acc
+
cur
,
0
)
}
},
mounted
()
{
this
.
getCardProducts
()
this
.
getWishlish
()
this
.
updateWishlist
()
this
.
updateCart
()
},
methods
:
{
methods
:
{
closeDialog
()
{
closeDialog
()
{
this
.
activeLogin
=
false
this
.
activeLogin
=
false
...
@@ -358,52 +279,255 @@ export default {
...
@@ -358,52 +279,255 @@ export default {
this
.
activeLogin
=
true
this
.
activeLogin
=
true
},
},
openDialogSignUp
()
{
openDialogSignUp
()
{
this
.
active
Login
=
false
this
.
active
Register
=
false
this
.
active
Login
=
true
this
.
active
Register
=
true
},
},
remove
(
index
)
{
removeCart
(
item
,
index
)
{
this
.
items
.
splice
(
index
,
1
)
try
{
console
.
log
(
this
.
items
)
this
.
$axios
.
delete
(
`/carts/delete-cart-item/
${
item
.
id
}
`
,
{
headers
:
{
Authorization
:
`Bearer
${
this
.
$auth
.
$storage
.
getUniversal
(
'
token
'
)}
`
}
})
.
then
((
response
)
=>
{
this
.
products
.
splice
(
index
,
1
)
this
.
$toast
.
success
(
'
Remove product successfully!
'
,
{
duration
:
1500
})
})
}
catch
(
error
)
{
console
.
log
(
error
)
this
.
$toast
.
error
(
'
ERR!
'
,
{
duration
:
1500
})
}
},
async
getCardProducts
()
{
await
this
.
$axios
.
get
(
`/carts/user-cart/
${
this
.
$auth
.
$storage
.
getUniversal
(
'
ID
'
)}
`
,
{
headers
:
{
Authorization
:
`Bearer
${
this
.
$auth
.
$storage
.
getUniversal
(
'
token
'
)}
`
}
})
.
then
((
response
)
=>
{
this
.
products
=
response
.
data
.
data
console
.
log
(
this
.
products
)
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
)
})
},
async
getWishlish
()
{
await
this
.
$axios
.
get
(
`/wish-list/user-wish-list/
${
this
.
$auth
.
$storage
.
getUniversal
(
'
ID
'
)}
`
,
{
headers
:
{
Authorization
:
`Bearer
${
this
.
$auth
.
$storage
.
getUniversal
(
'
token
'
)}
`
}
})
.
then
((
response
)
=>
{
this
.
wishlist
=
response
.
data
.
data
console
.
log
(
this
.
wishlist
)
})
.
catch
(
function
(
error
)
{
console
.
log
(
error
)
})
},
removeWishlist
(
item
,
index
)
{
try
{
this
.
$axios
.
delete
(
`/wish-list/delete-from-wish-list/
${
item
.
id
}
`
,
{
headers
:
{
Authorization
:
`Bearer
${
this
.
$auth
.
$storage
.
getUniversal
(
'
token
'
)}
`
}
})
.
then
((
response
)
=>
{
this
.
wishlist
.
splice
(
index
,
1
)
this
.
$toast
.
success
(
'
Remove product successfully!
'
,
{
duration
:
1500
})
})
}
catch
(
error
)
{
console
.
log
(
error
)
this
.
$toast
.
error
(
'
ERR!
'
,
{
duration
:
1500
})
}
},
updateWishlist
()
{
eventBus
.
$on
(
'
add-to-wish-list
'
,
(
response
)
=>
{
this
.
getWishlish
()
})
},
updateCart
()
{
eventBus
.
$on
(
'
add-to-cart
'
,
(
response
)
=>
{
console
.
log
(
'
abc
'
)
this
.
getCardProducts
()
})
}
}
}
}
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
scoped
>
.header-top
{
.header-top
{
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0.12
);
border-bottom
:
1px
solid
rgba
(
0
,
0
,
0
,
0.12
);
}
font-size
:
12px
;
b
{
color
:
rgba
(
0
,
0
,
0
,
0.8
);
display
:
block
;
font-family
:
"Segoe UI"
,
Tahoma
,
Geneva
,
Verdana
,
sans-serif
;
}
}
.col-md
{
.header-top-left
{
align-items
:
center
display
:
flex
;
}
align-items
:
center
;
.v-application
.d-flex
{
}
align-items
:
center
;
.header-top-right
{
}
display
:
flex
;
.favorite-modal
{
align-items
:
center
;
position
:
fixed
;
justify-content
:
space-between
;
}
z-index
:
10
;
.favorite-modal
.modal_header
{
}
padding
:
20px
0px
20px
30px
;
.dropdown
{
}
display
:
flex
;
.modal_header
>
b
{
cursor
:
pointer
;
font-weight
:
700
;
position
:
relative
;
font-size
:
16px
;
}
}
.dropdown
>
span
{
.modal_header
>
button
{
line-height
:
2rem
;
font-size
:
12px
;
}
}
.dropdown-content
{
.modal_header
>
i
{
display
:
none
;
scale
:
0.8
;
position
:
absolute
;
}
top
:
30px
;
.drawer_header
{
background
:
white
;
padding
:
20px
0
20px
30px
;
box-shadow
:
2px
2px
15px
3px
rgba
(
1
,
1
,
1
,
0.3
);
}
}
.v-menu__content
{
.dropdown-item
{
width
:
300px
;
margin
:
5px
7px
;
top
:
153px
!important
;
}
padding
:
25px
;
.v-divider--vertical
{
}
min-height
:
70%
;
max-height
:
70%
;
margin
:
5px
-1px
;
}
.header-info
{
cursor
:
pointer
;
}
span
:hover
{
color
:
#2266cc
;
cursor
:
pointer
;
}
.dropdown
:hover
.dropdown-content
{
display
:
block
;
}
.header-info
{
display
:
flex
;
align-items
:
center
;
}
.header-info
:hover
.span.v-icon
{
color
:
#2266cc
;
}
.authentication
{
display
:
flex
;
}
.v-icon.v-icon
{
margin
:
0
3px
;
}
.header-middle-content
{
display
:
flex
;
padding-left
:
0
;
padding-right
:
0
;
font-size
:
12px
;
color
:
#000000
;
}
.header-middle-left
{
display
:
flex
;
align-items
:
center
;
padding-right
:
0
;
padding-left
:
0
;
justify-content
:
space-between
;
}
.padding-0
{
padding
:
0
!important
;
}
.logo
{
display
:
flex
;
align-items
:
center
;
}
.form-search
{
width
:
100%
;
position
:
relative
;
margin
:
0
auto
;
margin
:
0
5vw
;
}
.search-input
{
width
:
inherit
;
position
:
absolute
;
}
span
.icon
{
position
:
absolute
;
right
:
5px
;
cursor
:
pointer
;
}
span
.icon
:hover
.v-icon.v-icon
{
color
:
#2266cc
;
}
.header-middle-right
{
display
:
flex
;
justify-content
:
space-between
;
}
b
{
display
:
block
;
font-size
:
14px
;
}
.hotline
{
cursor
:
pointer
;
}
.hotline
:hover
{
color
:
#2266cc
;
}
.wish-list
{
cursor
:
pointer
;
}
.wish-list
:hover
.v-icon.v-icon
{
color
:
#2266cc
;
}
.cart
{
display
:
flex
;
}
.v-application
.d-flex
{
align-items
:
center
;
}
.favorite-modal
{
position
:
fixed
;
}
.favorite-modal
.modal_header
{
padding
:
20px
0px
20px
30px
;
}
.modal_header
>
b
{
font-weight
:
700
;
font-size
:
16px
;
}
.modal_header
>
button
{
font-size
:
12px
;
}
.modal_header
>
i
{
scale
:
0.8
;
}
.drawer_header
{
padding
:
20px
0
20px
30px
;
}
.v-menu__content
{
width
:
300px
;
top
:
110px
!important
;
padding
:
25px
;
background-color
:
#ffffff
;
}
</
style
>
</
style
>
components/user/NavBar.vue
View file @
61ef56a1
<
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
>
...
...
layouts/user.vue
View file @
61ef56a1
<
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
>
nuxt.config.js
View file @
61ef56a1
...
@@ -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
...
...
pages/about.vue
View file @
61ef56a1
<
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
pages/login.vue
View file @
61ef56a1
...
@@ -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
'
,
{
...
...
store/index.js
View file @
61ef56a1
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment