front-end almost done | started back-end
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<ul>
|
||||
<admin-aside-item icon="fas fa-home" :link="{name: 'admin'}" text="صفحه اصلی"/>
|
||||
|
||||
<admin-aside-item icon="fas fa-presentation" :link="{name: 'admin-slider'}" text="اسلایدر"/>
|
||||
|
||||
<admin-aside-item icon="fas fa-image" :link="{name: 'admin-gallery'}" text="گالری"/>
|
||||
|
||||
<admin-aside-item icon="fa fa-gift" text="محصولات" :hasChild="true">
|
||||
<admin-aside-item :link="{name: 'admin-products'}" text="لیست محصولات"/>
|
||||
<admin-aside-item :link="{name: 'admin-products-category'}" text="دسته بندی محصولات"/>
|
||||
</admin-aside-item>
|
||||
|
||||
<admin-aside-item icon="fa fa-newspaper" text="بلاگ" :hasChild="true">
|
||||
<admin-aside-item :link="{name: 'admin-blog'}" text="لیست بلاگ"/>
|
||||
<admin-aside-item :link="{name: 'admin-blog-category'}" text="دسته بندی بلاگ"/>
|
||||
</admin-aside-item>
|
||||
|
||||
|
||||
<admin-aside-item icon="fas fa-user-friends" :link="{name: 'admin-customers'}" text="لیست مشتریان"/>
|
||||
|
||||
<admin-aside-item icon="fas fa-bags-shopping" :link="{name: 'admin-orders'}" text="لیست سفارشات"/>
|
||||
|
||||
<admin-aside-item icon="fas fa-envelope" :badge="$store.state.admin.unread" :link="{name: 'admin-messages'}" text="پیام های ارتباط با ما"/>
|
||||
|
||||
<admin-aside-item icon="fa fa-bullhorn" :link="{name: 'admin-broadcast'}" text="ارسال پیام برای مشتریان"/>
|
||||
|
||||
<admin-aside-item icon="far fa-file" :link="{name: 'admin-about'}" text="محتوای صفحه درباره ما"/>
|
||||
|
||||
</ul>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
mounted() {
|
||||
if (this.$auth.loggedIn) {
|
||||
this.$axios.get('/api/private/contact')
|
||||
.then(response => {
|
||||
let unread = response.data.filter(item => {
|
||||
return !item.read
|
||||
})
|
||||
this.$store.commit('admin/unreadCount', unread.length)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,60 @@
|
||||
<template>
|
||||
<nuxt-link :to="link" tag="li" v-if="!hasChild">
|
||||
<a>
|
||||
<i :class="icon"></i>
|
||||
<span>{{text}}</span>
|
||||
<span class="badge" v-if="badge">{{badge}}</span>
|
||||
</a>
|
||||
</nuxt-link>
|
||||
<li v-else>
|
||||
<ul>
|
||||
<li @click="toggle">
|
||||
<a>
|
||||
<i :class="icon"></i>
|
||||
<span>{{text}}</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="menu-group" :data-key="componentUniqueID">
|
||||
<slot/>
|
||||
</ul>
|
||||
</li>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
componentUniqueID: null
|
||||
}
|
||||
},
|
||||
props: {
|
||||
link: {
|
||||
required: false
|
||||
},
|
||||
icon: {
|
||||
required: false
|
||||
},
|
||||
text: {
|
||||
required: true
|
||||
},
|
||||
badge: {
|
||||
required: false
|
||||
},
|
||||
hasChild: {
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.componentUniqueID = Math.random() * 100
|
||||
$('.menu-group').slideUp()
|
||||
},
|
||||
methods: {
|
||||
toggle(e) {
|
||||
$(`.menu-group:not([data-key="${this.componentUniqueID}"])`).slideUp()
|
||||
$(`.menu-group[data-key="${this.componentUniqueID}"]`).slideToggle()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<header class="admin--header container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-6 headerSubDIV right">
|
||||
<!-- customer info -->
|
||||
<a href="/" target="_blank" class="customer">
|
||||
<!-- customer logo -->
|
||||
<div class="logo">
|
||||
<img src="~static/favicon.png" alt="">
|
||||
</div>
|
||||
<div class="name">
|
||||
<!-- customer name -->
|
||||
<p>هیما</p>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-6 headerSubDIV left">
|
||||
<!-- logout button -->
|
||||
<button class="logout" title="خارج شدن از حساب" @click="logOut">
|
||||
<i class="fa fa-power-off"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
logOut() {
|
||||
this.$confirm('از اکانت خارج شوید؟', 'هشدار', {
|
||||
confirmButtonText: 'بله',
|
||||
cancelButtonText: 'لغو',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$auth.logout()
|
||||
this.$router.push('/admin/login')
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: 'عملیات لغو شد'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,33 @@
|
||||
<template>
|
||||
<div class="language">
|
||||
<select v-model="selectedLocale">
|
||||
<option v-for="item in locale" :value="item.value">{{item.name}}</option>
|
||||
</select>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
selectedLocale: 'fa'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
locale() {
|
||||
return this.$store.state.admin.languages
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$axios.get('/api/public/locale')
|
||||
.then(response => {
|
||||
this.$store.commit('admin/updateLanguages', response.data)
|
||||
})
|
||||
},
|
||||
watch: {
|
||||
selectedLocale(oldVal, newVal) {
|
||||
this.$store.commit('admin/changeLocale', this.selectedLocale)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,5 @@
|
||||
<template>
|
||||
<div class="panel mb-3">
|
||||
<slot/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<div class="col-12 mb-3">
|
||||
<div class="row align-items-center justify-content-end title">
|
||||
<h2>{{title}}</h2>
|
||||
<slot/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
title: {
|
||||
required: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div class="container-fluid">
|
||||
<div class="user row align-items-center justify-content-lg-start">
|
||||
<el-avatar :size="50" :src="avatar"></el-avatar>
|
||||
<h2>{{user}}</h2>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {}
|
||||
},
|
||||
props: {
|
||||
user: {
|
||||
required: false,
|
||||
default: 'Admin'
|
||||
},
|
||||
avatar: {
|
||||
required: false,
|
||||
default: require('~/assets/admin/img/avatar.png')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user