update:add ci cd files ==> do not edit those file

This commit is contained in:
mahyargdz
2024-10-10 21:49:00 +03:30
parent 6fe34708a2
commit 8cf0492c87
464 changed files with 79533 additions and 0 deletions
+573
View File
@@ -0,0 +1,573 @@
<template>
<div class="about-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 s1-title anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">
{{ content.s1.t1 }}
</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-BG">
<div class="parallax">
<div class="row">
<div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 img paddingCol">
<img src="/img/AboutPage/_MG_9506.png" alt="" />
</div>
<div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 d-flex align-items-center descImg">
<div class="container anim-fadeInStagger">
<div class="descContainer section">
<h2 class="h2 staggerItem">{{ content.s2.t1 }}</h2>
<p class="description staggerItem">
{{ content.s2.t2 }}
</p>
<h6 class="h6 staggerItem">{{ content.s2.t3 }}</h6>
<div class="col-12 staggerItem">
<div class="row">
<!-- <div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 paddingCol">-->
<div class="features col-12 col-lg-6">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t4 }}</p>
</div>
<div class="features col-12 col-lg-6">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t5 }}</p>
</div>
<div class="features col-12 col-lg-6">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t6 }}</p>
</div>
<!-- </div>-->
<!-- <div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 paddingCol">-->
<div class="features col-12 col-lg-6">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t7 }}</p>
</div>
<div class="features col-12 col-lg-6">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t8 }}</p>
</div>
<!-- </div>-->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 3 ------------------------------------->
<section class="s3-BG">
<div class="parallax">
<!-- <div class="container-fluid">-->
<div class="row align-items-center">
<div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 s3-col1 paddingCol">
<div class="container anim-fadeInStagger">
<h2 class="h2 staggerItem">{{ content.s3.t1 }}</h2>
<p class="description staggerItem">
{{ content.s3.t2 }}
</p>
<nuxt-link
:to="{
name: 'lang-activities',
params: { lang: $route.params.lang }
}"
class="staggerItem"
>{{ content.s3.t3 }}</nuxt-link
>
</div>
</div>
<div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 s3-col2 paddingCol">
<div class="container-fluid anim-fadeInStagger">
<div class="col-12 features-body">
<nuxt-link
:to="{
name: 'lang-activities-piping',
params: { lang: $route.params.lang }
}"
>
<div class="features staggerItem">
<img src="/img/AboutPage/piping.png" alt="" />
<div>
<h6 class="h6">{{ content.s3.t6 }}</h6>
<span>
{{ content.s3.t7 }}
</span>
</div>
</div>
</nuxt-link>
<nuxt-link
:to="{
name: 'lang-activities-drilling',
params: { lang: $route.params.lang }
}"
>
<div class="features staggerItem">
<img src="/img/AboutPage/1111.png" alt="" />
<div>
<h6 class="h6">{{ content.s3.t12 }}</h6>
<span>
{{ content.s3.t13 }}
</span>
</div>
</div>
</nuxt-link>
<nuxt-link
:to="{
name: 'lang-activities-ward',
params: { lang: $route.params.lang }
}"
>
<div class="features staggerItem">
<img src="/img/AboutPage/petrochemical.png" alt="" />
<div>
<h6 class="h6">{{ content.s3.t4 }}</h6>
<span>
{{ content.s3.t5 }}
</span>
</div>
</div>
</nuxt-link>
<nuxt-link
:to="{
name: 'lang-activities-sm',
params: { lang: $route.params.lang }
}"
>
<div class="features staggerItem">
<img src="/img/AboutPage/2222.png" alt="" />
<div>
<h6 class="h6">{{ content.s3.t10 }}</h6>
<span>
{{ content.s3.t11 }}
</span>
</div>
</div>
</nuxt-link>
<nuxt-link
:to="{
name: 'lang-activities-srp',
params: { lang: $route.params.lang }
}"
>
<div class="features staggerItem">
<img src="/img/AboutPage/excavation.png" alt="" />
<div>
<h6 class="h6">{{ content.s3.t8 }}</h6>
<span>
{{ content.s3.t9 }}
</span>
</div>
</div>
</nuxt-link>
</div>
</div>
</div>
<!-- </div>-->
</div>
</div>
</section>
<!-- &lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45; Section 4 -&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
<!-- <section class="s4-BG">-->
<!-- <div class="parallax section">-->
<!-- <div class="container">-->
<!-- <div class="row">-->
<!-- <div class="col-12 col-md-12 col-lg-6 s4-col1 anim-fadeInStagger">-->
<!-- <h2 class="h2 staggerItem">{{ content.s4.t1 }}</h2>-->
<!-- <span class="staggerItem">-->
<!-- {{ content.s4.t2 }}-->
<!-- </span>-->
<!-- </div>-->
<!-- <div class="col-12 col-md-12 col-lg-6 s4-col2" v-if="projectCat.length > 0">-->
<!-- <div class="progress"-->
<!-- v-for="item in projectCat"-->
<!-- :key="item._id"-->
<!-- >-->
<!-- <div class="d-flex justify-content-between">-->
<!-- <span>{{ item.locale[$route.params.lang].name }}</span>-->
<!-- <span>{{ getPercentage(item) }}%</span>-->
<!-- </div>-->
<!-- <div class="progress-Parent">-->
<!-- <div class="progress-Child anim-progress"-->
<!-- :style="{width: `${projects.filter(e => e.category._id === item.id).length * 100 / projects.length}%`}"></div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-12 col-md-12 col-lg-6 s4-col3" v-else>-->
<!-- <h6 class="h6 notFound">{{ content.s4.t3 }}</h6>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </section>-->
<!---------------------------------- Section 5 ------------------------------------->
<!-- <section class="s5-Img-BG">-->
<!-- <div class="parallax section">-->
<!-- <div class="container">-->
<!-- <div class="title anim-fadeIn">-->
<!-- <h1 class="h2">{{ content.s5.t1 }}</h1>-->
<!-- <h1 class="h2">{{ content.s5.t2 }}</h1>-->
<!-- </div>-->
<!-- <div class="row anim-fadeIn" v-if="projectCat.length > 0">-->
<!-- <div class="col-12 col-lg-4 mb-3" v-for="cat in projectCat" :key="cat._id">-->
<!-- <h1 class="h1 s5-num1 anim-number">{{-->
<!-- projects.filter(item => {-->
<!-- if (item.category._id) return item.category._id === cat._id-->
<!-- }).length-->
<!-- }}</h1>-->
<!-- <span>{{ cat.locale[$route.params.lang].name }}</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="row" v-else>-->
<!-- <div class="col-12">-->
<!-- <h6 class="h4 notFound1">{{ content.s5.t3 }}</h6>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </section>-->
<!---------------------------------- Section 6 ------------------------------------->
<section class="s6-BG">
<div class="parallax section">
<div class="container">
<h2 class="h2 s6-h1-title anim-fadeIn">{{ content.s6.t1 }}</h2>
<div class="row s6-team" v-if="team.length > 0">
<div class="col-12 col-sm-6 col-lg-3 mb-3 anim-fadeIn" v-for="item in team" :key="item._id">
<div class="team-View">
<img
:src="item.image"
:alt="item.locale[$route.params.lang].first_name + ' ' + item.locale[$route.params.lang].last_name"
/>
<div class="title-Img">
<p>
{{ item.locale[$route.params.lang].first_name + ' ' + item.locale[$route.params.lang].last_name }}
</p>
<span>{{ item.locale[$route.params.lang].position }}</span>
</div>
</div>
</div>
</div>
<div class="row" v-else>
<div class="col-12 s6-notFound">
<h6 class="h6 notFound">{{ content.s6.t2 }}</h6>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 6 ------------------------------------->
<section class="s11-BG">
<div class="parallax section">
<div class="container-fluid">
<h2 class="h2 s11-h1-title anim-fadeIn">{{ content.s11.t1 }}</h2>
<div class="row s11-chart">
<div class="col-12 mb-3 anim-fadeIn">
<img src="/img/chart.jpg" alt="" v-if="$route.params.lang === 'fa'" />
<img src="/img/Chart-Latin.jpg" alt="" v-if="$route.params.lang === 'en'" />
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 7 ------------------------------------->
<section class="s7-BG">
<div class="parallax">
<div class="row">
<div class="col-12 s7-view-title">
<h2 class="h2 s7-title anim-fadeIn">{{ content.s7.t3 }}</h2>
</div>
<div class="col-12 col-lg-6 order-1 order-lg-0 s7-Body paddingCol">
<div class="container s7-body-row anim-fadeInStagger">
<div class="s7-Title staggerItem">
<h6 class="h6">{{ content.s7.t1 }}</h6>
</div>
<div class="s7-desc staggerItem">
<span>{{ content.s7.t2 }}</span>
</div>
<img src="/img/LogoCompany/5.png" alt="" />
<el-button type="text" @click="dialogVisible1 = true" class="staggerItemSeeBTN">
{{ content.s7.t4 }}
</el-button>
<el-dialog title="" :visible.sync="dialogVisible1" width="23%" center>
<div class="row">
<div class="col-12">
<img src="/img/AboutPage/GTC.png" :alt="content.s7.t1" width="100%" />
</div>
</div>
<el-button @click="dialogVisible1 = false">{{ content.s7.t5 }}</el-button>
</el-dialog>
</div>
</div>
<div class="col-12 col-lg-6 order-0 order-lg-1 paddingCol">
<div class="s7-Img">
<img src="/img/AboutPage/gtc.jpg" alt="" />
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 8 ------------------------------------->
<section class="s8-BG">
<div class="parallax">
<div class="row">
<div class="col-12 col-lg-6 paddingCol">
<div class="s8-Img">
<img src="/img/AboutPage/npa.jpg" alt="" />
</div>
</div>
<div class="col-12 col-lg-6 s8-Body paddingCol">
<div class="container s8-body-row anim-fadeInStagger">
<div class="s8-Title staggerItem">
<h6 class="h6">{{ content.s8.t1 }}</h6>
</div>
<div class="s8-desc staggerItem">
<span>{{ content.s8.t2 }}</span>
</div>
<!-- <div class="s8-Title staggerItem">-->
<!-- <h6 class="h6">{{ content.s8.t3 }}</h6>-->
<!-- </div>-->
<!-- <div class="s8-desc staggerItem">-->
<!-- <span>{{ content.s8.t4 }}</span>-->
<!-- </div>-->
<img src="/img/LogoCompany/4.png" alt="" />
<el-button type="text" @click="dialogVisible2 = true" class="staggerItemSeeBTN">
{{ content.s7.t4 }}
</el-button>
<el-dialog title="" :visible.sync="dialogVisible2" width="50%" center>
<div class="row">
<div class="col-12 col-md-6">
<img src="/img/AboutPage/Engemasa1.png" :alt="content.s7.t1" width="100%" />
</div>
<div class="col-12 col-md-6">
<img src="/img/AboutPage/Engemasa2.png" :alt="content.s7.t1" width="100%" />
</div>
</div>
<el-button @click="dialogVisible2 = false">{{ content.s7.t5 }}</el-button>
</el-dialog>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 9 ------------------------------------->
<section class="s9-BG">
<div class="parallax">
<div class="row">
<div class="col-12 col-lg-6 order-1 order-lg-0 s9-Body paddingCol">
<div class="container s9-body-row anim-fadeInStagger">
<div class="s9-Title staggerItem">
<h6 class="h6">{{ content.s9.t1 }}</h6>
</div>
<div class="s9-desc staggerItem">
<span>{{ content.s9.t2 }}</span>
</div>
<img src="/img/LogoCompany/3.png" alt="" />
<el-button type="text" @click="dialogVisible3 = true" class="staggerItemSeeBTN">
{{ content.s7.t4 }}
</el-button>
<el-dialog title="" :visible.sync="dialogVisible3" width="23%" center>
<div class="row">
<div class="col-12">
<img src="/img/AboutPage/Hj.png" :alt="content.s7.t1" width="100%" />
</div>
</div>
<el-button @click="dialogVisible3 = false">{{ content.s7.t5 }}</el-button>
</el-dialog>
</div>
</div>
<div class="col-12 col-lg-6 order-0 order-lg-1 paddingCol">
<div class="s9-Img">
<img src="/img/AboutPage/metal.jpg" alt="" />
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 10 ------------------------------------->
<section class="s10-BG">
<div class="parallax">
<div class="row">
<div class="col-12 col-lg-6 paddingCol">
<div class="s10-Img">
<img src="/img/AboutPage/wonjin.jpeg" alt="" />
</div>
</div>
<div class="col-12 col-lg-6 s10-Body paddingCol">
<div class="container s10-body-row anim-fadeInStagger">
<div class="s10-Title staggerItem">
<h6 class="h6">{{ content.s10.t1 }}</h6>
</div>
<div class="s10-desc staggerItem">
<span>{{ content.s10.t2 }}</span>
</div>
<img src="/img/LogoCompany/2.png" alt="" />
<el-button type="text" @click="dialogVisible4 = true" class="staggerItemSeeBTN">
{{ content.s7.t4 }}
</el-button>
<el-dialog title="" :visible.sync="dialogVisible4" width="23%" center>
<div class="row">
<div class="col-12">
<img src="/img/AboutPage/WONJIN.png" :alt="content.s7.t1" width="100%" />
</div>
</div>
<el-button @click="dialogVisible4 = false">{{ content.s7.t5 }}</el-button>
</el-dialog>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 12 logo company ------------------------------------->
<!-- <section class="s12-BG">-->
<!-- <div class="parallax">-->
<!-- <h2>مشتریان ما</h2>-->
<!-- <div class="row">-->
<!-- <div class="col-12 col-md-4">-->
<!-- <img src="/img/LogoCompany/logo1.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-12 col-md-4">-->
<!-- <img src="/img/LogoCompany/logo2.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-12 col-md-4">-->
<!-- <img src="/img/LogoCompany/logo3.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-12 col-md-4">-->
<!-- <img src="/img/LogoCompany/logo4.png" alt="">-->
<!-- </div>-->
<!-- <div class="col-12 col-md-4">-->
<!-- <img src="/img/LogoCompany/logo5.png" alt="">-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </section>-->
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation
} from '~/utils/animations'
export default {
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
methods: {
lineRed() {
this.projects.length
},
getPercentage(item) {
return Math.floor(
(this.projects.filter(e => {
if (e.category._id) return e.category._id === item.id
}).length *
100) /
this.projects.length
)
}
},
data() {
return {
team: null,
projects: null,
projectCat: null,
dialogVisible1: false,
dialogVisible2: false,
dialogVisible3: false,
dialogVisible4: false,
defaultCover: '/img/AboutPage/page-title.png'
}
},
async asyncData({ $axios, error }) {
try {
const allData = await Promise.all([
// fetch team [0]
$axios.get('/api/public/teams'),
// fetch projects [1]
$axios.get('/api/public/projects'),
// fetch project categories [2]
$axios.get('/api/public/projectCategories')
])
const team = allData[0]
const projects = allData[1]
const projectCat = allData[2]
return {
team: team.data,
projects: projects.data,
projectCat: projectCat.data
}
} catch (e) {
error({ status: 500, message: 'there is a problem here' })
}
},
computed: {
content() {
return this.$store.state.content.about[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.aboutUS
}
}
}
</script>
<style scoped>
.about-page span {
display: block;
text-align: justify;
}
</style>
+165
View File
@@ -0,0 +1,165 @@
<template>
<div class="activities-details-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-Img-BG">
<div class="parallax">
<div class="row">
<div class="col-12 centerItem s2-item">
<div class="s2-body">
<div class="container anim-fadeInStagger">
<div class="_s2-Desc-View">
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t1 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t2 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t3 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t4 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t5 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t6 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t7 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t8 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t9 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t10 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t11 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t12 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t13 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t14 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t15 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t16 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t17 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t18 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t19 }}</p>
</div>
</div>
<a class="btn btn-primary" href="./../../../static/DEISEL.pdf" download="">دانلود pdf</a>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation
} from '@/utils/animations'
export default {
data() {
return {
defaultCover: '/img/ActivitiesPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-Img-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
methods: {
goDown(element) {
this.$gsap.to(window, { scrollTo: element, duration: 0.7 })
}
},
computed: {
content() {
return this.$store.state.content.dieselConnex[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.activity
}
}
}
</script>
+159
View File
@@ -0,0 +1,159 @@
<template>
<div class="activities-details-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">
{{ content.s1.t1 }}
</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-Img-BG">
<div class="parallax">
<div class="row">
<div class="col-12 col-lg-6 s2-item">
<img src="/img/ActivitiesPage/DetailsPage/api.jpg" alt="" class="s2-img" />
</div>
<div class="col-12 col-lg-6 centerItem s2-item">
<div class="s2-body">
<div class="container anim-fadeInStagger">
<div class="row">
<div class="s2-body-desc staggerItem mb-3">
<p>
{{ content.s2.t1 }}
</p>
</div>
<!-- <div class="_s2-Desc-View">-->
<!-- <div class="check">-->
<!-- <i class="fas fa-check-circle"></i>-->
<!-- <p>-->
<!-- {{ content.s2.t2 }}-->
<!-- </p>-->
<!-- </div>-->
<!-- <div class="check">-->
<!-- <i class="fas fa-check-circle"></i>-->
<!-- <p>-->
<!-- {{ content.s2.t3 }}-->
<!-- </p>-->
<!-- </div>-->
<!-- <div class="check">-->
<!-- <i class="fas fa-check-circle"></i>-->
<!-- <p>-->
<!-- {{ content.s2.t4 }}-->
<!-- </p>-->
<!-- </div>-->
<!-- </div>-->
</div>
<template>
<el-table ref="singleTable" :data="tableData" border style="width: 100%">
<el-table-column property="v1" width="120"></el-table-column>
<el-table-column property="v2" :label="content.s2.t6"></el-table-column>
<el-table-column property="v3" :label="content.s2.t7"></el-table-column>
<el-table-column property="v4" :label="content.s2.t8"></el-table-column>
</el-table>
</template>
<div class="view_input">
<SheetWCM mini whiteTxt />
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation
} from '@/utils/animations'
export default {
data() {
return {
defaultCover: '/img/ActivitiesPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-Img-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
this.tableData[
{
date: this.content.s2.t9
}
]
})
},
methods: {
goDown(element) {
this.$gsap.to(window, { scrollTo: element, duration: 0.7 })
}
},
computed: {
content() {
return this.$store.state.content.drilling[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.activity
},
tableData() {
return [
{
v1: this.content.s2.t9,
v2: this.content.s2.t12,
v3: this.content.s2.t13,
v4: this.content.s2.t14
},
{
v1: this.content.s2.t10,
v2: this.content.s2.t15,
v3: this.content.s2.t16,
v4: this.content.s2.t17
},
{
v1: this.content.s2.t11,
v2: this.content.s2.t18,
v3: this.content.s2.t19,
v4: this.content.s2.t20
}
]
}
}
}
</script>
+148
View File
@@ -0,0 +1,148 @@
<template>
<div class="activities-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax d-flex align-items-center flex-column justify-content-center"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
<span class="anim-fadeIn">
{{ content.s1.t2 }}
</span>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-BG section">
<div class="parallax">
<div class="container">
<div class="row anim-fadeIn">
<div class="col-12 col-sm-6 col-lg-4 s2-align-col anim-fadeIn">
<div class="s2-item">
<nuxt-link :to="{ name: 'lang-activities-piping', params: { lang: $route.params.lang } }">
<img src="/img/ActivitiesPage/piping.jpg" alt="" />
<div class="s2-body">
<StrokedTxt text="01" />
<h4 class="h4">{{ content.s2.t1 }}</h4>
</div>
</nuxt-link>
</div>
</div>
<div class="col-12 col-sm-6 col-lg-4 s2-align-col anim-fadeIn">
<div class="s2-item">
<nuxt-link :to="{ name: 'lang-activities-drilling', params: { lang: $route.params.lang } }">
<img src="/img/ActivitiesPage/drill.jpg" alt="" />
<div class="s2-body">
<StrokedTxt text="02" />
<h4 class="h4">{{ content.s2.t2 }}</h4>
</div>
</nuxt-link>
</div>
</div>
<div class="col-12 col-sm-6 col-lg-4 s2-align-col anim-fadeIn">
<div class="s2-item">
<nuxt-link :to="{ name: 'lang-activities-ward', params: { lang: $route.params.lang } }">
<img src="/img/ActivitiesPage/petro.jpg" alt="" />
<div class="s2-body">
<StrokedTxt text="03" />
<h4 class="h4">{{ content.s2.t3 }}</h4>
</div>
</nuxt-link>
</div>
</div>
<div class="col-12 col-sm-6 col-lg-4 s2-align-col anim-fadeIn">
<div class="s2-item">
<nuxt-link :to="{ name: 'lang-activities-sm', params: { lang: $route.params.lang } }">
<img src="/img/ActivitiesPage/Salt.jpg" alt="" />
<div class="s2-body">
<StrokedTxt text="04" />
<h4 class="h4">{{ content.s2.t4 }}</h4>
</div>
</nuxt-link>
</div>
</div>
<div class="col-12 col-sm-6 col-lg-4 s2-align-col anim-fadeIn">
<div class="s2-item">
<nuxt-link :to="{ name: 'lang-activities-srp', params: { lang: $route.params.lang } }">
<img src="/img/ActivitiesPage/faraz.jpg" alt="" />
<div class="s2-body">
<StrokedTxt text="05" />
<h4 class="h4">{{ content.s2.t5 }}</h4>
</div>
</nuxt-link>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
import { fadeInAnimation, fadeInStaggerAnimation } from '~/utils/animations'
export default {
data() {
return {
defaultCover: '/img/ActivitiesPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG > div'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
computed: {
content() {
return this.$store.state.content.activities[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.activity
}
}
}
</script>
<style scoped>
.activities-page .s2-BG .parallax .container .s2-align-col .s2-item .s2-body {
padding: 13px 25px;
position: absolute;
bottom: 0;
background: #00000075;
min-height: 138px;
width: 100%;
}
.activities-page .s2-BG .parallax .container .s2-align-col .s2-item {
width: auto;
margin-bottom: 25px;
background-color: #888585;
direction: ltr;
text-align: left;
overflow: hidden;
position: relative;
}
</style>
+120
View File
@@ -0,0 +1,120 @@
<template>
<div class="activities-details-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">
{{ content.s1.t1 }}
</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-Img-BG">
<div class="parallax">
<div class="row">
<div class="col-12 col-lg-6 s2-item">
<img src="/img/ActivitiesPage/DetailsPage/erw.jpg" alt="" class="s2-img" />
</div>
<div class="col-12 col-lg-6 centerItem s2-item">
<div class="s2-body">
<div class="container anim-fadeInStagger">
<div class="row">
<div class="col-12 s2-body-desc staggerItem mb-3">
<p>
{{ content.s2.t1 }}
</p>
</div>
</div>
<template>
<el-table :data="tableData" border style="width: 100%">
<el-table-column prop="v1" :label="content.s2.t14"> </el-table-column>
<el-table-column prop="v2" :label="content.s2.t7"> </el-table-column>
<el-table-column prop="v3" :label="content.s2.t8"> </el-table-column>
<el-table-column prop="v4" :label="content.s2.t9"> </el-table-column>
</el-table>
</template>
<div class="view_input">
<PipeWCM mini whiteTxt />
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation
} from '@/utils/animations'
export default {
data() {
return {
defaultCover: '/img/ActivitiesPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-Img-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
methods: {
goDown(element) {
this.$gsap.to(window, { scrollTo: element, duration: 0.7 })
}
},
computed: {
content() {
return this.$store.state.content.piping[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.activity
},
tableData() {
return [
{
v1: this.content.s2.t13,
v2: this.content.s2.t10,
v3: this.content.s2.t11,
v4: this.content.s2.t12
}
]
}
}
}
</script>
+275
View File
@@ -0,0 +1,275 @@
<template>
<div class="activities-details-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-Img-BG">
<div class="parallax">
<div class="row">
<div class="col-12 col-lg-6 s2-item">
<img src="/img/ActivitiesPage/DetailsPage/skid.jpg" alt="" class="s2-img" />
</div>
<div class="col-12 col-lg-6 centerItem s2-item">
<div class="s2-body">
<div class="container anim-fadeInStagger">
<div class="row">
<div class="s2-body-desc staggerItem">
<p>
{{ content.s2.t1 }}
</p>
</div>
<div class="s2-Desc-View staggerItem">
<div class="row">
<div class="col-12 col-md-6 paddingCol">
<div class="check" @click="goDown('.p1')">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t2 }}
</p>
</div>
</div>
<div class="col-12 col-md-6 paddingCol">
<div class="check" @click="goDown('.p2')">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t3 }}
</p>
</div>
</div>
<!-- <div class="col-12 col-md-6 paddingCol">-->
<!-- <div class="check" @click="goDown('.p3')">-->
<!-- <i class="fas fa-check-circle"></i>-->
<!-- <p>-->
<!-- {{ content.s2.t4 }}-->
<!-- </p>-->
<!-- </div>-->
<!-- </div>-->
<div class="col-12 col-md-6 paddingCol">
<div class="check" @click="goDown('.p4')">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t5 }}
</p>
</div>
</div>
<div class="col-12 col-md-6 paddingCol">
<div class="check" @click="goDown('.p4')">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t6 }}
</p>
</div>
</div>
<div class="col-12 col-md-6 paddingCol">
<div class="check" @click="goDown('.p4')">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t7 }}
</p>
</div>
</div>
<div class="col-12 col-md-6 paddingCol">
<div class="check" @click="goDown('.p4')">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t8 }}
</p>
</div>
</div>
</div>
</div>
<div class="s2-body-desc2 staggerItem">
<p>
{{ content.s2.t9 }}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 3 ------------------------------------->
<!-- <section class="s3-BG section">-->
<!-- <div class="container">-->
<!-- <div class="row">-->
<!-- <div class="col-12 item reverse anim-fadeInStagger p1 paddingCol">-->
<!-- <div class="row staggerItem">-->
<!-- <div class="col-12 col-md-7 paddingCol">-->
<!-- <img-->
<!-- src="/img/ActivitiesPage/DetailsPage/drilling1.jpg"-->
<!-- alt=""-->
<!-- />-->
<!-- </div>-->
<!-- <div class="col-12 col-md-5 d-flex flex-column justify-content-center paddingCol">-->
<!-- <div class="txt">-->
<!-- <h6 class="h6">-->
<!-- {{ content.s3.t1 }}-->
<!-- </h6>-->
<!-- <ul class="list2">-->
<!-- <li><i class="fas fa-check"></i> {{ content.s3.t2 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s3.t3 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s3.t4 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s3.t5 }}</li>-->
<!-- </ul>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-12 item anim-fadeInStagger p2 paddingCol">-->
<!-- <div class="row staggerItem">-->
<!-- <div class="col-12 col-md-7 paddingCol">-->
<!-- <img-->
<!-- src="/img/ActivitiesPage/DetailsPage/drilling2.jpg"-->
<!-- alt=""-->
<!-- />-->
<!-- </div>-->
<!-- <div class="col-12 col-md-5 d-flex flex-column justify-content-center paddingCol">-->
<!-- <div class="txt">-->
<!-- <h6 class="h6">{{ content.s4.t1 }}</h6>-->
<!-- <ul class="list2">-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t1 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t2 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t3 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t4 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t5 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t6 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t7 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t8 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t9 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t10 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t11 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t12 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t13 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t14 }}</li>-->
<!-- </ul>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-12 item reverse anim-fadeInStagger p3 paddingCol">-->
<!-- <div class="row staggerItem">-->
<!-- <div class="col-12 col-md-7 paddingCol">-->
<!-- <img-->
<!-- src="/img/ActivitiesPage/DetailsPage/drilling3.jpg"-->
<!-- alt=""-->
<!-- />-->
<!-- </div>-->
<!-- <div class="col-12 col-md-5 d-flex flex-column justify-content-center paddingCol">-->
<!-- <div class="txt">-->
<!-- <h6 class="h6">-->
<!-- {{ content.s5.t1 }}-->
<!-- </h6>-->
<!-- <ul class="list2">-->
<!-- <li><i class="fas fa-check"></i> {{ content.s5.t2 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s5.t3 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s5.t4 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s5.t5 }}</li>-->
<!-- </ul>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-12 item descBottom p4 paddingCol">-->
<!-- <div class="container">-->
<!-- <div class="row">-->
<!-- <div class="col-12 paddingCol">-->
<!-- <div class="txt">-->
<!-- <h6 class="h6 mb-5">-->
<!-- {{ content.s6.t1 }}-->
<!-- </h6>-->
<!-- <p>-->
<!-- {{ content.s6.t2 }}-->
<!-- </p>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </section>-->
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation
} from '@/utils/animations'
export default {
data() {
return {
defaultCover: '/img/ActivitiesPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
})
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-Img-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
},
methods: {
goDown(element) {
this.$gsap.to(window, { scrollTo: element, duration: 0.7 })
}
},
computed: {
content() {
return this.$store.state.content.skid[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.activity
}
}
}
</script>
+233
View File
@@ -0,0 +1,233 @@
<template>
<div class="activities-details-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-Img-BG">
<div class="parallax">
<div class="row">
<div class="col-12 col-lg-6 s2-item">
<img src="/img/ActivitiesPage/DetailsPage/srp.jpg" alt="" class="s2-img" />
</div>
<div class="col-12 col-lg-6 centerItem s2-item">
<div class="s2-body">
<div class="container anim-fadeInStagger">
<div class="row">
<div class="s2-body-desc staggerItem">
<p>{{ content.s2.t1 }}</p>
<p>{{ content.s2.t6 }}</p>
</div>
</div>
<div class="_s2-Desc-View">
<div class="check">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t2 }}
</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t3 }}
</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t4 }}
</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t5 }}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 3 ------------------------------------->
<!-- <section class="s3-BG section">-->
<!-- <div class="container">-->
<!-- <div class="row">-->
<!-- <div class="col-12 item reverse anim-fadeInStagger p1 paddingCol">-->
<!-- <div class="row staggerItem">-->
<!-- <div class="col-12 col-md-7 paddingCol">-->
<!-- <img-->
<!-- src="/img/ActivitiesPage/DetailsPage/drilling1.jpg"-->
<!-- alt=""-->
<!-- />-->
<!-- </div>-->
<!-- <div class="col-12 col-md-5 d-flex flex-column justify-content-center paddingCol">-->
<!-- <div class="txt">-->
<!-- <h6 class="h6">-->
<!-- {{ content.s3.t1 }}-->
<!-- </h6>-->
<!-- <ul class="list2">-->
<!-- <li><i class="fas fa-check"></i> {{ content.s3.t2 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s3.t3 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s3.t4 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s3.t5 }}</li>-->
<!-- </ul>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-12 item anim-fadeInStagger p2 paddingCol">-->
<!-- <div class="row staggerItem">-->
<!-- <div class="col-12 col-md-7 paddingCol">-->
<!-- <img-->
<!-- src="/img/ActivitiesPage/DetailsPage/drilling2.jpg"-->
<!-- alt=""-->
<!-- />-->
<!-- </div>-->
<!-- <div class="col-12 col-md-5 d-flex flex-column justify-content-center paddingCol">-->
<!-- <div class="txt">-->
<!-- <h6 class="h6">{{ content.s4.t1 }}</h6>-->
<!-- <ul class="list2">-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t1 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t2 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t3 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t4 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t5 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t6 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t7 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t8 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t9 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t10 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t11 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t12 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t13 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t14 }}</li>-->
<!-- </ul>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-12 item reverse anim-fadeInStagger p3 paddingCol">-->
<!-- <div class="row staggerItem">-->
<!-- <div class="col-12 col-md-7 paddingCol">-->
<!-- <img-->
<!-- src="/img/ActivitiesPage/DetailsPage/drilling3.jpg"-->
<!-- alt=""-->
<!-- />-->
<!-- </div>-->
<!-- <div class="col-12 col-md-5 d-flex flex-column justify-content-center paddingCol">-->
<!-- <div class="txt">-->
<!-- <h6 class="h6">-->
<!-- {{ content.s5.t1 }}-->
<!-- </h6>-->
<!-- <ul class="list2">-->
<!-- <li><i class="fas fa-check"></i> {{ content.s5.t2 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s5.t3 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s5.t4 }}</li>-->
<!-- <li><i class="fas fa-check"></i> {{ content.s5.t5 }}</li>-->
<!-- </ul>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-12 item descBottom p4 paddingCol">-->
<!-- <div class="container">-->
<!-- <div class="row">-->
<!-- <div class="col-12 paddingCol">-->
<!-- <div class="txt">-->
<!-- <h6 class="h6 mb-5">-->
<!-- {{ content.s6.t1 }}-->
<!-- </h6>-->
<!-- <p>-->
<!-- {{ content.s6.t2 }}-->
<!-- </p>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </section>-->
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation
} from '@/utils/animations'
export default {
data() {
return {
defaultCover: '/img/ActivitiesPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-Img-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
methods: {
goDown(element) {
this.$gsap.to(window, { scrollTo: element, duration: 0.7 })
}
},
computed: {
content() {
return this.$store.state.content.srp[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.activity
}
}
}
</script>
+161
View File
@@ -0,0 +1,161 @@
<template>
<div class="activities-details-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-Img-BG">
<div class="parallax">
<div class="row">
<div class="col-12 centerItem s2-item">
<div class="s2-body">
<div class="container anim-fadeInStagger">
<div class="_s2-Desc-View">
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t1 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t2 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t3 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t4 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t5 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t6 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t7 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t8 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t9 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t10 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t11 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t12 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t13 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t14 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t15 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t16 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t17 }}</p>
</div>
<div class="check">
<i class="fas fa-check-circle"></i>
<p>{{ content.s2.t18 }}</p>
</div>
</div>
<a class="btn btn-primary" href="./../../../static/SRP.pdf" download="">دانلود pdf</a>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation
} from '@/utils/animations'
export default {
data() {
return {
defaultCover: '/img/ActivitiesPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-Img-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
methods: {
goDown(element) {
this.$gsap.to(window, { scrollTo: element, duration: 0.7 })
}
},
computed: {
content() {
return this.$store.state.content.srpConex[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.activity
}
}
}
</script>
+246
View File
@@ -0,0 +1,246 @@
<template>
<div class="activities-details-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-Img-BG">
<div class="parallax">
<div class="row">
<div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 s2-item">
<img src="/img/ActivitiesPage/DetailsPage/petrochemy.jpg" alt="" class="s2-img" />
</div>
<div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 centerItem s2-item">
<div class="s2-body">
<div class="container anim-fadeInStagger">
<div class="row">
<div class="s2-body-desc staggerItem">
<p>
{{ content.s2.t1 }}
</p>
</div>
<div class="s2-Desc-View staggerItem">
<div class="row">
<div class="col-12 col-md-6 paddingCol" @click="goDown('.p1')">
<div class="check">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t2 }}
</p>
</div>
</div>
<div class="col-12 col-md-6 paddingCol" @click="goDown('.p3')">
<div class="check">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t3 }}
</p>
</div>
</div>
<div class="col-12 col-md-6 paddingCol" @click="goDown('.p2')">
<div class="check">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t4 }}
</p>
</div>
</div>
<div class="col-12 col-md-6 paddingCol" @click="goDown('.p4')">
<div class="check">
<i class="fas fa-check-circle"></i>
<p>
{{ content.s2.t5 }}
</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 3 ------------------------------------->
<section class="s3-BG section">
<div class="container">
<div class="row">
<div class="col-12 item reverse anim-fadeInStagger p1 paddingCol">
<div class="row staggerItem">
<div class="col-12 col-md-7 paddingCol">
<img src="/img/ActivitiesPage/DetailsPage/1111.jpg" alt="" />
</div>
<div class="col-12 col-md-5 d-flex flex-column justify-content-center paddingCol">
<div class="txt">
<h6 class="h6">
{{ content.s3.t1 }}
</h6>
<!-- <ul class="list1">-->
<!-- <li><i class="fas fa-circle"></i>{{ content.s3.t2 }}</li>-->
<!-- <li><i class="fas fa-circle"></i>{{ content.s3.t3 }}</li>-->
<!-- <li><i class="fas fa-circle"></i>{{ content.s3.t4 }}</li>-->
<!-- <li><i class="fas fa-circle"></i>{{ content.s3.t5 }}</li>-->
<!-- </ul>-->
<!-- <p>{{ content.s3.t6 }}</p>-->
<!-- <ul class="list2">-->
<!-- <li><i class="fas fa-check"></i>{{ content.s3.t7 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s3.t8 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s3.t9 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s3.t10 }}</li>-->
<!-- </ul>-->
</div>
</div>
</div>
</div>
<div class="col-12 item anim-fadeInStagger p2 paddingCol">
<div class="row staggerItem">
<div class="col-12 col-md-7 paddingCol">
<img src="/img/ActivitiesPage/DetailsPage/header.jpg" alt="" />
</div>
<div class="col-12 col-md-5 d-flex flex-column justify-content-center paddingCol">
<div class="txt">
<h6 class="h6">
{{ content.s4.t1 }}
</h6>
<!-- <ul class="list2">-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t2 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t3 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t4 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t5 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t6 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s4.t7 }}</li>-->
<!-- </ul>-->
</div>
</div>
</div>
</div>
<div class="col-12 item reverse anim-fadeInStagger p3 paddingCol">
<div class="row staggerItem">
<div class="col-12 col-md-7 paddingCol">
<img src="/img/ActivitiesPage/DetailsPage/gtc.jpg" alt="" />
</div>
<div class="col-12 col-md-5 d-flex flex-column justify-content-center paddingCol">
<div class="txt">
<h6 class="h6">
{{ content.s5.t1 }}
</h6>
<!-- <ul class="list2">-->
<!-- <li><i class="fas fa-check"></i>{{ content.s5.t2 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s5.t3 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s5.t4 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s5.t5 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s5.t6 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s5.t7 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s5.t8 }}</li>-->
<!-- </ul>-->
</div>
</div>
</div>
</div>
<div class="col-12 item anim-fadeInStagger p4 paddingCol">
<div class="row staggerItem">
<div class="col-12 col-md-7 paddingCol">
<img src="/img/ActivitiesPage/DetailsPage/petrochemy1.jpg" alt="" />
</div>
<div class="col-12 col-md-5 d-flex flex-column justify-content-center paddingCol">
<div class="txt">
<h6 class="h6">
{{ content.s6.t1 }}
</h6>
<!-- <ul class="list2">-->
<!-- <li><i class="fas fa-check"></i>{{ content.s6.t2 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s6.t3 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s6.t4 }}</li>-->
<!-- <li><i class="fas fa-check"></i>{{ content.s6.t5 }}</li>-->
<!-- </ul>-->
</div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation
} from '@/utils/animations'
export default {
data() {
return {
defaultCover: '/img/ActivitiesPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-Img-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
methods: {
goDown(element) {
this.$gsap.to(window, { scrollTo: element, duration: 0.7 })
}
},
computed: {
content() {
return this.$store.state.content.ward[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.activity
}
}
}
</script>
+233
View File
@@ -0,0 +1,233 @@
<template>
<div class="blog-details-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{ backgroundImage: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url(${post.cover})` }"
>
<div class="s1-title anim-fadeIn">
<div class="date">
<p>{{ jDateDay(post.createt_at) }}</p>
<p>{{ jDateMonth(post.created_at) }}</p>
</div>
<div class="s1-desc">
<h6 class="h6">{{ post.locale[$route.params.lang].title }}</h6>
<div>
<IconBlogDetailsFolderIcon/>
<span> {{ content.s1.t1 }} </span>
<IconBlogDetailsCategoryIcon/>
<span> {{ post.category ? post.category.locale[$route.params.lang].title : 'No Category' }} </span>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-BG">
<div class="s2-desc anim-leftToRight">
<p>{{ content.s2.t2 }}</p>
<i class="fas" :class="$route.params.lang === 'fa' ? 'fa-angle-left' : 'fa-angle-right'"></i>
<p>{{ content.s2.t1 }}</p>
<i class="fas" :class="$route.params.lang === 'fa' ? 'fa-angle-left' : 'fa-angle-right'"></i>
<p>{{ post.locale[$route.params.lang].title }}</p>
</div>
</section>
<!---------------------------------- Section Content ------------------------------------->
<section class="content section">
<div class="container">
<div class="row">
<div class="col-12">
<div class="ck-content" v-html="post.locale[$route.params.lang].description"></div>
<div v-if="post.video" class="mt-3 d-flex justify-content-center">
<video height="400" controls :src="post.video"></video>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 8 ------------------------------------->
<section class="s8-Img-BG anim-fadeInStagger" v-if="post.last_section_image">
<div
class="parallax"
:style="{
backgroundImage: `linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url(${post.last_section_image})`
}"
>
<h2 class="h2 staggerItem" v-if="post.locale[$route.params.lang].last_section_image_title">
{{ post.locale[$route.params.lang].last_section_image_title }}
</h2>
<div class="s8-desc staggerItem" v-if="post.locale[$route.params.lang].last_section_image_description">
<p>{{ post.locale[$route.params.lang].last_section_image_description }}</p>
</div>
</div>
</section>
<!---------------------------------- Section 9 ------------------------------------->
<section class="s9-BG" v-if="post.locale[$route.params.lang].last_section_title">
<div class="parallax section">
<div class="container anim-fadeInStagger">
<div class="s9-title staggerItem">
<h5 class="h5">{{ post.locale[$route.params.lang].last_section_title }}</h5>
</div>
<div class="s9-desc staggerItem">
<p>{{ post.locale[$route.params.lang].last_section_description }}</p>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 10 ------------------------------------->
<section class="s10-BG">
<div class="">
<div class="s10-shares">
<!-- <p>0 SHARES</p>-->
</div>
<div class="s10-social">
<ul>
<li>
<ShareNetwork
network="facebook"
:url="'https://orisoxin.com' + $route.fullPath"
:title="post.locale[$route.params.lang].title"
:description="post.locale[$route.params.lang].short_description"
hashtags="orsioxin"
>
<i class="fab fa-facebook-f"></i>
</ShareNetwork>
</li>
<li>
<ShareNetwork
network="Twitter"
:url="'https://orisoxin.com' + $route.fullPath"
:title="post.locale[$route.params.lang].title"
:description="post.locale[$route.params.lang].short_description"
hashtags="orsioxin"
>
<i class="fab fa-twitter"></i>
</ShareNetwork>
</li>
<li>
<ShareNetwork
network="LinkedIn"
:url="'https://orisoxin.com' + $route.fullPath"
:title="post.locale[$route.params.lang].title"
:description="post.locale[$route.params.lang].short_description"
hashtags="orsioxin"
>
<i class="fab fa-linkedin-in"></i>
</ShareNetwork>
</li>
<li>
<ShareNetwork
network="Email"
:url="'https://orisoxin.com' + $route.fullPath"
:title="post.locale[$route.params.lang].title"
:description="post.locale[$route.params.lang].short_description"
hashtags="orsioxin"
>
<i class="fas fa-envelope"></i>
</ShareNetwork>
</li>
<!-- <li>-->
<!-- <ShareNetwork-->
<!-- network="SMS"-->
<!-- :url="'https://orisoxin.com' + $route.fullPath"-->
<!-- :title="post.locale[$route.params.lang].title"-->
<!-- :description="post.locale[$route.params.lang].short_description"-->
<!-- hashtags="orsioxin"-->
<!-- >-->
<!-- <i class="fab fa-google-plus-g"></i>-->
<!-- </ShareNetwork>-->
<!-- </li>-->
</ul>
</div>
</div>
</section>
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation,
rightToLeftAnimation
} from '@/utils/animations'
import moment from 'moment-jalaali'
export default {
data() {
return {
post: null
}
},
methods: {
jDateDay(date) {
let dateFormat = moment(date)
if (this.$route.params.lang === 'fa') {
moment.loadPersian()
return dateFormat.format('jYYYY/jMM/jDD').split('/')[2]
} else {
return dateFormat.format('yyyy/mm/DD').split('/')[2]
}
},
jDateMonth(date) {
let dateFormat = moment(date)
if (this.$route.params.lang === 'fa') {
moment.loadPersian()
return dateFormat.format('jYYYY/jMMMM/jDD').split('/')[1]
} else {
return dateFormat.format('yyyy/MMM/DD').split('/')[1]
}
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
rightToLeftAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '10%'
})
})
},
computed: {
content() {
return this.$store.state.content.blogDetails[this.$route.params.lang]
}
},
async asyncData({$axios, params, error}) {
try {
const post = await $axios.get(`/api/public/blogPost/${encodeURIComponent(params.post)}`)
return {
post: post.data
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+226
View File
@@ -0,0 +1,226 @@
<template>
<div class="blog-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-BG">
<div class="container">
<div class="row">
<div class="col-12">
<ul>
<nuxt-link
class="s2-all-cat"
tag="li"
:to="{ name: 'lang-blog', params: { lang: $route.params.lang }, query: { category: 'all', page: 1 } }"
>
<a :class="$route.query.category === 'all' ? 'active' : null">{{ content.s2.t1 }}</a>
</nuxt-link>
<nuxt-link
class="s2-all-cat"
v-for="item in blogCategories"
:key="item._id"
tag="li"
:to="{
name: 'lang-blog',
params: { lang: $route.params.lang },
query: { category: item.locale[$route.params.lang].title, page: 1 }
}"
>
<a :class="$route.query.category === item.locale[$route.params.lang].title ? 'active' : null">{{
item.locale[$route.params.lang].title
}}</a>
</nuxt-link>
</ul>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 3 ------------------------------------->
<section class="s3-BG">
<div class="parallax section">
<div class="container">
<div class="row align-items-stretch" v-if="blogPosts.docs.length">
<div class="col-12 col-md-6 col-lg-4 mb-4 anim-fadeIn" v-for="item in blogPosts.docs" :key="item._id">
<div class="s3-item">
<img :src="item.thumb" :alt="item.locale[$route.params.lang].title" />
<div class="s3-body">
<div class="s3-top-desc">
<div>
<i class="far fa-circle"></i>
<span>{{ jDate(item.created_at) }}</span>
</div>
<!-- <div>-->
<!-- <i class="far fa-clone"></i>-->
<!-- <span>{{ item.name }}</span>-->
<!-- </div>-->
<div>
<i class="far fa-folder-open"></i>
<span>{{ item.category ? item.category.locale[$route.params.lang].title : 'No Category' }}</span>
</div>
</div>
<h6 class="h6">{{ item.locale[$route.params.lang].title }}</h6>
<p>{{ item.locale[$route.params.lang].short_description }}</p>
<nuxt-link
:to="{
name: 'lang-blog-post',
params: { lang: $route.params.lang, post: item.locale[$route.params.lang].title }
}"
class="s3-reading"
>
<p>
{{ content.s3.t1 }}
<i class="fas" :class="$route.params.lang === 'en' ? 'fa-arrow-right' : 'fa-arrow-left'"></i>
</p>
</nuxt-link>
</div>
</div>
</div>
<div class="col-12" v-if="!blogPosts.docs.length">
<p>there is no post yet</p>
</div>
</div>
<div class="row" v-else>
<div class="col-12 s3-notFound">
<h6 class="h6 notFound">{{ content.s3.t2 }}</h6>
</div>
</div>
</div>
</div>
</section>
<!-- paginate -->
<section class="pagination section">
<div class="row">
<div class="col-12">
<el-pagination
layout="prev, pager, next"
v-if="paginate"
class="el-pagination"
@current-change="pageNumber"
:current-page="Number($route.query.page)"
:page-count="Number(blogPosts.totalPages)"
>
</el-pagination>
</div>
</div>
</section>
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation
} from '~/utils/animations'
import moment from 'moment-jalaali'
export default {
data() {
return {
blogPosts: null,
blogCategories: null,
defaultCover: '/img/BlogPage/page-title.png'
}
},
computed: {
paginate() {
return this.blogPosts.totalPages > 1
},
category() {
return this.$route.query.category
},
page() {
return this.$route.query.page
},
content() {
return this.$store.state.content.blog[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.blog
}
},
watch: {
category(newVal, oldVal) {
this.$nuxt.refresh()
},
page(newVal, oldVal) {
this.$nuxt.refresh()
}
},
methods: {
pageNumber(val) {
this.$router.push({
name: 'lang-blog',
params: { lang: this.$route.params.lang },
query: { category: this.$route.query.category, page: val }
})
},
jDate(date) {
return moment(date).locale('fa').format(' HH:mm - jYYYY/jMM/jDD')
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG > div'), {
duration: 9,
opacity: 0,
y: '10%'
})
})
},
async asyncData({ $axios, error, query }) {
try {
const allData = await Promise.all([
// fetch blogCategories [0]
$axios.get(`/api/public/blogCategories`),
// fetch blogPosts [1]
$axios.get(`/api/public/blogPosts?category=${encodeURIComponent(query.category)}&page=${query.page}`)
])
const blogCategories = allData[0]
const blogPosts = allData[1]
return {
blogCategories: blogCategories.data,
blogPosts: blogPosts.data
}
} catch (e) {
error({ status: 404, message: 'page not found' })
}
}
}
</script>
+115
View File
@@ -0,0 +1,115 @@
<template>
<div class="catalog-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-BG section">
<div class="parallax">
<div class="container">
<div class="row" v-if="catalogs.length">
<div
class="col-12 col-lg-3 mb-3"
v-for="item in catalogs"
:key="item._id"
v-if="($route.params.lang === 'fa' && item.showInFa) || ($route.params.lang === 'en' && item.showInEn)"
>
<div class="s2-item">
<img
:src="item.cover"
:alt="item.locale[$route.params.lang].title"
:title="item.locale[$route.params.lang].title"
/>
<div class="s2-body">
<a :href="item.file" target="_blank" :title="item.locale[$route.params.lang].title" download>{{
content.s2.t1
}}</a>
</div>
</div>
</div>
</div>
<div class="row" v-else>
<div class="col-12 s2-notFound">
<h6 class="h6 notFound">{{ content.s2.t2 }}</h6>
</div>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation,
rightToLeftAnimation
} from '@/utils/animations'
export default {
data() {
return {
catalogs: null,
defaultCover: '/img/BlogPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
rightToLeftAnimation(this.$gsap),
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG > div'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
async asyncData({ $axios, error }) {
try {
const catalogs = await $axios.get('/api/public/catalogs')
return {
catalogs: catalogs.data
}
} catch (e) {
error({ status: 500, message: 'there is a problem here' })
}
},
computed: {
content() {
return this.$store.state.content.catalog[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.catalog
}
}
}
</script>
+52
View File
@@ -0,0 +1,52 @@
<template>
<div class="consents-page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-Img-BG">
<div class="parallax section">
<div class="container">
<div class="row">
<div class="col-12 col-md-6 col-lg-3 view-img" v-for="item in 53" :key="item + '_orsiOxinConsent'">
<a :href="`/img/ConsentsPage/${item}.jpg`">
<img :src="`/img/ConsentsPage/${item}.jpg`" title="consent" alt="OrisOxin-consents" class="img" />
</a>
</div>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
export default {
data() {
return {
defaultCover: '/img/GalleryPage/page-title.png',
consentsCount: 53
}
},
mounted() {
$(document).ready(() => {
// certificates
new SimpleLightbox('.s2-Img-BG .view-img a')
})
},
computed: {
content() {
return this.$store.state.content.consents[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.consent
}
}
}
</script>
+509
View File
@@ -0,0 +1,509 @@
<template>
<div class="contact-page page">
<!---------------------------------- Section 1 ------------------------------------->
<div class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</div>
<!---------------------------------- Section 2 ------------------------------------->
<div class="s2">
<div class="parallax">
<div id="slides" class="row">
<div class="col-12 col-md-6 col-lg-4 s2-item slide">
<div class="s2-img s2-Img-col1 anim-fadeInStagger">
<h4 class="h4 staggerItem">{{ content.s2.t19 }}</h4>
<p class="s2-desc staggerItem" style="margin-bottom: 0">ENGEMASA</p>
<p class="s2-desc staggerItem" style="margin-top: 0">
{{ content.s2.t20 }}
</p>
<div class="s2-tel staggerItem">
<ul>
<li>
<b>{{ content.s2.t9 }}: </b>
<a href="tel:+551633631500">+551633631500</a>
</li>
<li>
<b>{{ content.s2.t10 }}: </b>
<a href="mailto:info[at]orisoxin.com">info[at]orisoxin.com</a>
</li>
<li>
<b>{{ content.s2.t23 }}: </b>
<a href="www.engemasa.com.br">www.engemasa.com.br</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-lg-4 s2-item slide">
<div class="s2-img s2-Img-col2 anim-fadeInStagger">
<h4 class="h4 staggerItem">{{ content.s2.t15 }}</h4>
<p class="s2-desc staggerItem" style="margin-bottom: 0">NPA</p>
<p class="s2-desc staggerItem" style="margin-top: 0">
{{ content.s2.t16 }}
</p>
<div class="s2-tel staggerItem">
<ul>
<li>
<b>{{ content.s2.t9 }}: </b>
<a href="tel:+8653287314976">+86 532 87314976</a>
</li>
<li>
<b>{{ content.s2.t24 }}: </b>
<a href="tel:+8653287314975">+86 532 87314975</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-lg-4 s2-item slide">
<div class="s2-img s2-Img-col3 anim-fadeInStagger">
<h4 class="h4 staggerItem">{{ content.s2.t17 }}</h4>
<p class="s2-desc staggerItem">
{{ content.s2.t18 }}
</p>
<div class="s2-tel staggerItem">
<ul>
<li>
<b>{{ content.s2.t9 }}: </b>
<a href="tel:82(55)5874570">82(55)5874570</a>
</li>
<li>
<b>{{ content.s2.t24 }}: </b>
<a href="tel:82(55)5873330">82(55)5873330</a>
</li>
<li>
<b>{{ content.s2.t10 }}: </b>
<a href="mailto:info[at]orisoxin.com">info[at]orisoxin.com</a>
</li>
<li>
<b>{{ content.s2.t23 }}: </b>
<a href="www.GasComp.kr">www.GasComp.kr</a>
</li>
</ul>
</div>
</div>
</div>
<!-- <div class="col-12 col-md-6 col-lg-4 s2-item slide">-->
<!-- <div class="s2-img s2-Img-col2 anim-fadeInStagger">-->
<!-- <h4 class="h4 staggerItem">{{ content.s2.t19 }}</h4>-->
<!-- <p class="s2-desc staggerItem">-->
<!-- {{ content.s2.t20 }}-->
<!-- </p>-->
<!-- <div class="s2-tel staggerItem">-->
<!-- <ul>-->
<!-- <li>-->
<!-- <b>{{ content.s2.t9 }}: </b>-->
<!-- <a href="tel:+49021152295480">0049-021152295480</a>-->
<!-- </li>-->
<!-- <li>-->
<!-- <b>{{ content.s2.t10 }}: </b>-->
<!-- <a href="mailto:info[at]orisoxin.com">info[at]orisoxin.com</a>-->
<!-- </li>-->
<!-- </ul>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="col-12 col-md-6 col-lg-4 s2-item slide">
<div class="s2-img s2-Img-col1 anim-fadeInStagger">
<h4 class="h4 staggerItem">{{ content.s2.t21 }}</h4>
<p class="s2-desc staggerItem">
{{ content.s2.t22 }}
</p>
<div class="s2-tel staggerItem">
<ul>
<li>
<b>{{ content.s2.t9 }}: </b>
<a href="tel:+8222083233840">+82-2-2083-2338-40</a>
</li>
<li>
<b>{{ content.s2.t24 }}: </b>
<a href="tel:+82220832341">+82-2-2083-2341</a>
</li>
<li>
<b>{{ content.s2.t23 }}: </b>
<a href="www.kdw.co.kr">www.kdw.co.kr</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-lg-4 s2-item slide">
<div class="s2-img s2-Img-col2 anim-fadeInStagger">
<h4 class="h4 staggerItem">{{ content.s2.t13 }}</h4>
<p class="s2-desc staggerItem" style="margin-bottom: 0">HJ Metal Korea</p>
<p class="s2-desc staggerItem" style="margin-top: 0">
{{ content.s2.t14 }}
</p>
<div class="s2-tel staggerItem">
<ul>
<li>
<b>{{ content.s2.t9 }}: </b>
<a href="tel:+82325724081">+82 32 572 4081-2</a>
</li>
<li>
<b>{{ content.s2.t24 }}: </b>
<a href="tel:+82325724086">+82 32 572 4086</a>
</li>
<li>
<b>{{ content.s2.t10 }}: </b>
<a href="mailto:info[at]orisoxin.com">info[at]orisoxin.com</a>
</li>
<li>
<b>{{ content.s2.t23 }}: </b>
<a href="www.hjmk.co.kr">www.hjmk.co.kr</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-lg-4 s2-item slide">
<div class="s2-img s2-Img-col7 anim-fadeInStagger">
<h4 class="h4 staggerItem">{{ content.s2.t5 }}</h4>
<p class="s2-desc staggerItem">
{{ content.s2.t6 }}
</p>
<div class="s2-tel staggerItem">
<ul>
<li>
<b>{{ content.s2.t25 }}: </b>
<a href="tel:03132747303">031-32747303</a>
</li>
<li>
<b>{{ content.s2.t10 }}: </b>
<a href="mailto:info[at]orisoxin.com">info[at]orisoxin.com</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-lg-4 s2-item slide">
<div class="s2-img s2-Img-col6 anim-fadeInStagger">
<h4 class="h4 staggerItem">{{ content.s2.t3 }}</h4>
<p class="s2-desc staggerItem">
{{ content.s2.t4 }}
</p>
<div class="s2-tel staggerItem">
<ul>
<li>
<b>{{ content.s2.t9 }}: </b>
<a href="tel:06134491021">0613-4491021</a>
</li>
<li>
<b>{{ content.s2.t9 }}: </b>
<a href="tel:06134491022">0613-4491022</a>
</li>
<li>
<b>{{ content.s2.t10 }}: </b>
<a href="mailto:info[at]orisoxin.com">info[at]orisoxin.com</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-lg-4 s2-item slide">
<div class="s2-img s2-Img-col5 anim-fadeInStagger">
<h4 class="h4 staggerItem">{{ content.s2.t1 }}</h4>
<p class="s2-desc staggerItem">
{{ content.s2.t2 }}
</p>
<div class="s2-tel staggerItem">
<ul>
<li>
<b>{{ content.s2.t9 }}: </b>
<a href="tel:06134427626">0613-4427626</a>
</li>
</ul>
</div>
</div>
</div>
<div class="col-12 col-md-6 col-lg-4 s2-item slide">
<div class="s2-img s2-Img-col4 anim-fadeInStagger">
<h4 class="h4 staggerItem">{{ content.s2.t11 }}</h4>
<p class="s2-desc staggerItem">
{{ content.s2.t12 }}
</p>
<div class="s2-tel staggerItem">
<ul>
<li>
<b>{{ content.s2.t9 }}: </b>
<a href="tel:02188612602">021-88612602</a>
</li>
<li>
<b>{{ content.s2.t24 }}: </b>
<a href="tel:02188612603">021-88612603</a>
</li>
<li>
<b>{{ content.s2.t10 }}: </b>
<a href="mailto:info[at]orisoxin.com">info[at]orisoxin.com</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!---------------------------------- Section 3 ------------------------------------->
<div class="s3">
<div class="parallax section">
<div class="container">
<div class="row">
<div class="col-12 order-1 order-lg-0 col-lg-7 info anim-fadeInStagger">
<div class="s3-title-col1 staggerItem">
<h6 class="h6">{{ content.s3.t1 }}</h6>
</div>
<div class="s3-desc-col1 staggerItem">
<p>
{{ content.s3.t2 }}
</p>
</div>
<div class="s3-input staggerItem">
<form @submit.prevent="post">
<div class="fromRow" :class="validation.name ? 'err' : null">
<input v-model="message.name" class="input" name="name" type="text" :placeholder="content.s3.t3" />
<p v-if="validation.name">{{ validation.name.msg }}</p>
</div>
<div class="formRow" :class="validation.email ? 'err' : null">
<input
v-model="message.email"
class="input"
name="email"
type="text"
:placeholder="content.s3.t4"
/>
<p v-if="validation.email">{{ validation.email.msg }}</p>
</div>
<div class="formRow" :class="validation.subject ? 'err' : null">
<input
v-model="message.subject"
class="input"
name="subject"
type="text"
:placeholder="content.s3.t5"
/>
<p v-if="validation.subject">{{ validation.subject.msg }}</p>
</div>
<div class="formRow" :class="validation.message ? 'err' : null">
<textarea v-model="message.message" class="input" rows="6" :placeholder="content.s3.t6"></textarea>
<p v-if="validation.message">{{ validation.message.msg }}</p>
</div>
<div class="btnSub">
<button class="btn-link" type="submit">{{ content.s3.t7 }}</button>
<!-- <nuxt-link >SUBMIT NOW</nuxt-link> -->
</div>
</form>
</div>
</div>
<div class="col-12 order-0 mb-5 mb-lg-0 order-lg-1 col-lg-5 location anim-fadeInStagger">
<div class="s3-title-col2 staggerItem">
<h6 class="h6">{{ content.s3.t8 }}</h6>
</div>
<div class="s3-address staggerItem">
<p>
{{ content.s3.t9 }}
</p>
</div>
<div class="email staggerItem">
<i class="fas fa-envelope"></i>
<span><a href="mailto:info[at]orisoxin.com">info[at]orisoxin.com</a></span>
</div>
<div class="tel staggerItem">
<i class="fas fa-phone-alt"></i>
<span><a href="tel:02188612602">021-88612602</a></span>
</div>
<div class="tel staggerItem">
<i class="fas fa-fax"></i>
<span><a href="tel:02188612603">021-88612603</a></span>
</div>
<div class="s3-title-col2-row2 staggerItem">
<h6 class="h6">Map</h6>
<div class="mapouter">
<div class="gmap_canvas">
<iframe
src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3237.46662168324!2d51.394458715552624!3d35.76391253303978!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x3f8e06f906e67b41%3A0x98bfda631d3b9527!2z2LTYsdqp2Kog2KfYsduM2LMg2Kfaqdiz24zZhg!5e0!3m2!1sen!2sfr!4v1632141129226!5m2!1sen!2sfr"
width="400"
height="200"
style="border: 0"
allowfullscreen=""
loading="lazy"
></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
if (process.client) require('slick-carousel')
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation,
rightToLeftAnimation
} from '@/utils/animations'
export default {
data() {
return {
message: {
name: '',
email: '',
subject: '',
message: '',
locale: this.$route.params.lang
},
validation: {},
defaultCover: '/img/GalleryPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
rightToLeftAnimation(this.$gsap)
// Address carousel
$('#slides').slick({
// autoplay: true,
accessibility: false,
arrows: true,
dots: false,
slidesToShow: 3,
slidesToScroll: 1,
infinite: false,
autoplaySpeed: 2000,
rtl: this.$route.params.lang === 'fa',
responsive: [
{
breakpoint: 1200,
settings: {
slidesToShow: 2,
slidesToScroll: 1
}
},
{
breakpoint: 769,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
arrows: true
}
}
]
})
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
methods: {
post() {
this.validation = {}
this.$axios
.post('/api/public/contact', this.message)
.then(res => {
this.$message({
type: 'success',
message: 'message sent successfully'
})
this.message = {
name: '',
email: '',
subject: '',
message: '',
locale: this.$route.params.lang
}
})
.catch(e => {
if (e.response.status === 422) this.validation = e.response.data.validation
else console.log(e)
})
}
},
computed: {
content() {
return this.$store.state.content.contact[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.contact
}
}
}
</script>
<style lang="scss" scoped>
.mapouter {
position: relative;
text-align: right;
height: 250px;
width: 100%;
margin-top: 20px;
.gmap_canvas {
overflow: hidden;
background: none !important;
height: 100%;
width: 100%;
iframe {
width: 100%;
height: 100%;
}
}
}
.slick-slide:nth-child(-n + 5) .s2-img h4 {
margin-right: auto;
text-align: left;
}
.slick-slide:nth-child(-n + 5) .s2-desc {
text-align: left;
margin-right: auto;
direction: ltr;
max-width: 100% !important;
}
// .slick-slide .s8-tel{
// text-align: left;
// }
.slick-slide .s2-tel a:lang(fa) {
direction: ltr !important;
}
</style>
+91
View File
@@ -0,0 +1,91 @@
<template>
<div class="gallery-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 3 ------------------------------------->
<section class="s3-BG section">
<div class="container">
<template v-if="images.length">
<div class="row">
<div class="col-12 col-md-3" v-for="item in images" :key="item._id">
<div class="imgBox">
<a :href="item.image">
<img :src="item.thumb" :alt="item.locale[$route.params.lang].title" />
</a>
</div>
</div>
</div>
</template>
<div class="row" v-else>
<div class="col-12 s3-notFound">
<h6 class="h6 notFound">{{ content.s3.t2 }}</h6>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
export default {
data() {
return {
images: null,
cover: null,
defaultCover: '/img/GalleryPage/page-title.png'
}
},
mounted() {
this.$nextTick(() => {
new SimpleLightbox('.gallery-page .s3-BG .imgBox a')
})
//--------------------------------------------------------- Section 1
// this.$gsap.timeline({
// scrollTrigger: {
// trigger: ".s2-BG",
// scrub: true,
// start: "top top",
// }
// })
// .to($('.s1-Img-BG .parallax'), {
// duration: 9,
// opacity: 0,
// y: '50%'
// })
},
computed: {
content() {
return this.$store.state.content.gallery[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.gallery
}
},
async asyncData({ $axios, params }) {
try {
const images = await $axios.get(`/api/public/gallery/${params.images}`)
return {
images: images.data
}
} catch (e) {
console.log('e', e.message)
}
}
}
</script>
<style scoped></style>
+224
View File
@@ -0,0 +1,224 @@
<template>
<div class="gallery-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<!-- <section class="s2-BG">-->
<!-- <div class="container">-->
<!-- <div class="row">-->
<!-- <div class="col-12">-->
<!-- <ul>-->
<!-- <nuxt-link-->
<!-- class="s2-all-cat"-->
<!-- :to="{name: 'lang-gallery',params: {lang: $route.params.lang},query: {category: 'all'}}"-->
<!-- tag="li"-->
<!-- >-->
<!-- <a :class="$route.query.category === 'all' ? 'active' : null">{{ content.s2.t1 }}</a>-->
<!-- </nuxt-link>-->
<!-- <nuxt-link-->
<!-- class="s2-all-cat"-->
<!-- :to="{name: 'lang-gallery',params: {lang: $route.params.lang},query: {category: 'no-category'}}"-->
<!-- tag="li"-->
<!-- >-->
<!-- <a :class="$route.query.category === 'no-category' ? 'active' : null">{{ content.s2.t2 }}</a>-->
<!-- </nuxt-link>-->
<!-- <nuxt-link-->
<!-- class="s2-all-cat"-->
<!-- v-for="item in galleryCategories"-->
<!-- :key="item._id"-->
<!-- :to="{name: 'lang-gallery',params: {lang: $route.params.lang},query: {category: item.locale[$route.params.lang].title}}"-->
<!-- tag="li"-->
<!-- >-->
<!-- <a :class="$route.query.category === item.locale[$route.params.lang].title ? 'active' : null">{{-->
<!-- item.locale[$route.params.lang].title-->
<!-- }}</a>-->
<!-- </nuxt-link>-->
<!-- </ul>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </section>-->
<!---------------------------------- Section 3 ------------------------------------->
<section class="s3-BG section">
<div class="container">
<template v-if="galleryCategories.length">
<!-- start gallery row -->
<!-- <div class="col-12 col-md-3" v-for="(item,index) in imageChunk" :key="index">-->
<div class="row">
<div class="col-12 col-md-3" v-for="item in galleryCategories" :key="item._id">
<nuxt-link :to="{ name: 'lang-gallery-images', params: { lang: $route.params.lang, images: item._id } }">
<div class="imgBox">
<img
:src="item.thumb.includes('undefined') ? '/img/default-img.png' : item.thumb"
:alt="item.locale[$route.params.lang].title"
/>
<h4>{{ item.locale[$route.params.lang].title }}</h4>
</div>
</nuxt-link>
</div>
<!-- </div>-->
<!-- <pre>{{ filteredImages }}</pre>-->
</div>
<!-- <div class="gallery&#45;&#45;row" v-for="(item,index) in imageChunk" :key="index"-->
<!-- :class="index%2 !== 0 ? 'gallery&#45;&#45;row-reverse' : null"-->
<!-- >-->
<!-- <div class="row top">-->
<!-- <div class="col-5 left anim-fadeIn">-->
<!-- <div class="imgBox" v-if="item.length >= 1">-->
<!-- <a :href="item[0].image">-->
<!-- <img :src="item[0].thumb" :title="item[0].locale[$route.params.lang].caption"-->
<!-- :alt="item[0].locale[$route.params.lang].caption">-->
<!-- </a>-->
<!-- </div>-->
<!--&lt;!&ndash; <div class="txtBox anim-fadeIn" v-if="item.length >= 3">&ndash;&gt;-->
<!--&lt;!&ndash; <img src="/img/GalleryPage/logo-colored.svg" alt=""/>&ndash;&gt;-->
<!--&lt;!&ndash; <p>&ndash;&gt;-->
<!--&lt;!&ndash; {{ content.s3.t1 }}&ndash;&gt;-->
<!--&lt;!&ndash; </p>&ndash;&gt;-->
<!--&lt;!&ndash; </div>&ndash;&gt;-->
<!-- </div>-->
<!-- <div class="col-7 right anim-fadeIn">-->
<!-- <div class="imgBox" v-if="item.length >= 2">-->
<!-- <a :href="item[1].image">-->
<!-- <img :src="item[1].thumb" :title="item[1].locale[$route.params.lang].caption"-->
<!-- :alt="item[1].locale[$route.params.lang].caption">-->
<!-- </a>-->
<!-- </div>-->
<!-- <div class="imgBox" v-if="item.length >= 3">-->
<!-- <a :href="item[2].image">-->
<!-- <img :src="item[2].thumb" :title="item[2].locale[$route.params.lang].caption"-->
<!-- :alt="item[2].locale[$route.params.lang].caption">-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="row bottom" v-if="item.length >= 4">-->
<!-- <div class="col-8 anim-fadeIn">-->
<!-- <div class="imgBox" v-if="item.length >= 4">-->
<!-- <a :href="item[3].image">-->
<!-- <img :src="item[3].thumb" :title="item[3].locale[$route.params.lang].caption"-->
<!-- :alt="item[3].locale[$route.params.lang].caption">-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-4 anim-fadeIn">-->
<!-- <div class="imgBox" v-if="item.length >= 5">-->
<!-- <a :href="item[4].image">-->
<!-- <img :src="item[4].thumb" :title="item[4].locale[$route.params.lang].caption"-->
<!-- :alt="item[4].locale[$route.params.lang].caption">-->
<!-- </a>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- end gallery row -->
</template>
<div class="row" v-else>
<div class="col-12 s3-notFound">
<h6 class="h6 notFound">{{ content.s3.t2 }}</h6>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation,
rightToLeftAnimation
} from '@/utils/animations'
export default {
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
rightToLeftAnimation(this.$gsap)
})
//--------------------------------------------------------- Section 1
// this.$gsap.timeline({
// scrollTrigger: {
// trigger: ".s2-BG",
// scrub: true,
// start: "top top",
// }
// })
// .to($('.s1-Img-BG .parallax'), {
// duration: 9,
// opacity: 0,
// y: '50%'
// })
},
data() {
return {
galleryCategories: null,
images: null,
defaultCover: '/img/GalleryPage/page-title.png'
}
},
computed: {
filteredImages() {
if (this.$route.query.category === 'all') return this.images
else if (this.$route.query.category === 'no-category') return this.images.filter(item => item.noCategory)
else
return this.images.filter(
item =>
!item.noCategory && item.category.locale[this.$route.params.lang].title === this.$route.query.category
)
},
imageChunk() {
const images = this.filteredImages
const chunkSize = 5
let imageChunk = []
let chunk = []
images.forEach((item, index) => {
chunk.push(item)
if ((index + 1) % chunkSize === 0) {
imageChunk.push(chunk)
chunk = []
}
if (index === images.length - 1 && chunk.length) imageChunk.push(chunk)
})
return imageChunk
},
content() {
return this.$store.state.content.gallery[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.gallery
}
},
async asyncData({ $axios }) {
const galleryCategories = await $axios.get(`/api/public/galleryCategories`)
return {
galleryCategories: galleryCategories.data
}
}
}
</script>
File diff suppressed because it is too large Load Diff
+254
View File
@@ -0,0 +1,254 @@
<template>
<div class="details-project-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section
class="s1-Img-BG"
:style="{ backgroundImage: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), url(${project.cover})` }"
>
<div class="parallax">
<h1 class="h1 anim-fadeIn">{{ project.locale[$route.params.lang].title }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-Img-BG">
<div class="parallax">
<div class="row">
<div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 s2-img">
<img :src="project.s2_image" :alt="project.locale[$route.params.lang].title" />
</div>
<div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 s2-desc-row">
<div class="s2-body d-flex align-items-center">
<div class="container anim-fadeInStagger">
<div class="row">
<h2 class="h2 staggerItem">{{ content.s2.t1 }}</h2>
<div class="s2-body-desc staggerItem">
<span>{{ project.locale[$route.params.lang].description }}</span>
</div>
<div class="s2-Desc-View staggerItem">
<div class="row align-items-stretch s2-list-row">
<div class="col-12 col-md-2 s2-Desc" v-if="project.locale[$route.params.lang].client">
<h6 class="h6">{{ content.s2.t2 + ' : ' }}</h6>
</div>
<div
class="col-12 col-md-10 mb-3 mb-md-0 s2-Desc"
v-if="project.locale[$route.params.lang].client"
>
<p>{{ project.locale[$route.params.lang].client || '******' }}</p>
</div>
<div class="col-6 col-md-2 s2-Desc" v-if="project.locale[$route.params.lang].skills">
<h6 class="h6">{{ content.s2.t3 + ' : ' }}</h6>
</div>
<div
class="col-6 col-md-10 mb-3 mb-md-0 s2-Desc"
v-if="project.locale[$route.params.lang].skills"
>
<p>{{ project.locale[$route.params.lang].size || '******' }}</p>
</div>
<div class="col-6 col-md-2 s2-Desc">
<h6 class="h6" v-if="project.locale[$route.params.lang].area">{{ content.s2.t4 + ' : ' }}</h6>
</div>
<div
class="col-6 col-md-10 mb-3 mb-md-0 s2-Desc"
v-if="project.locale[$route.params.lang].website"
>
<p>{{ project.locale[$route.params.lang].area || '******' }}</p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 3 ------------------------------------->
<section class="s3-BG">
<div class="parallax">
<div class="container">
<div class="s3-body anim-fadeInStagger">
<h6 class="h6 staggerItem">{{ project.locale[$route.params.lang].s3_title }}</h6>
<div class="s3-desc staggerItem">
<span>{{ project.locale[$route.params.lang].s3_description }}</span>
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 4 ------------------------------------->
<section class="s4-Img-BG">
<div class="parallax">
<div id="slides">
<div class="slide" v-if="project.s4_image">
<div class="content">
<img :src="project.s4_image" :alt="project.locale[$route.params.lang].title" />
</div>
</div>
<div class="slide" v-for="item in project.images" :key="item._id">
<div class="content">
<img :src="item.thumb" :alt="project.locale[$route.params.lang].title" />
</div>
</div>
</div>
</div>
</section>
<!---------------------------------- Section lightBox ------------------------------------->
<section class="lightBoxImages">
<div class="images">
<a
v-for="(item, index) in project.images"
:key="item._id + 1"
:class="index === 0 ? 'btn' : 'hidden'"
:href="item.image"
>{{ content.s5.t1 }}</a
>
</div>
</section>
<!-- &lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45; Section 5 -&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
<!-- <section class="s5-BG">-->
<!-- <div class="parallax">-->
<!-- <div class="row">-->
<!-- <div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 paddingCol">-->
<!-- <div class="s5-Img">-->
<!-- <img :src="project.s5_image" :alt="project.locale[$route.params.lang].title"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 s5-Body paddingCol">-->
<!-- <div class="container anim-fadeInStagger">-->
<!-- <div class="s5-Title staggerItem">-->
<!-- <h6 class="h6">{{ project.locale[$route.params.lang].s5_title }}</h6>-->
<!-- </div>-->
<!-- <div class="s5-desc staggerItem">-->
<!-- <span>{{ project.locale[$route.params.lang].s5_description }}</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </section>-->
<!-- &lt;!&ndash;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45; Section 6 -&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&#45;&ndash;&gt;-->
<!-- <section class="s6-BG">-->
<!-- <div class="parallax">-->
<!-- <div class="row">-->
<!-- <div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 s6-Body paddingCol">-->
<!-- <div class="container s6-body-row anim-fadeInStagger">-->
<!-- <div class="s6-Title staggerItem">-->
<!-- <h6 class="h6">{{ project.locale[$route.params.lang].s6_title }}</h6>-->
<!-- </div>-->
<!-- <div class="s6-desc staggerItem">-->
<!-- <span>{{ project.locale[$route.params.lang].s6_description }}</span>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12 paddingCol">-->
<!-- <div class="s6-Img">-->
<!-- <img :src="project.s6_image" :alt="project.locale[$route.params.lang].title"-->
<!-- />-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </section>-->
<!---------------------------------- Section 7 ------------------------------------->
<section class="s7-BG">
<div class="parallax">
<div class="container">
<div class="s7-body">
<h6 class="h6">{{ content.s7.t1 }}</h6>
<div class="s7-desc">
<span>{{ content.s7.t2 }}</span>
</div>
</div>
</div>
</div>
</section>
</div>
</template>
<script>
if (process.client) require('slick-carousel')
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation,
rightToLeftAnimation
} from '@/utils/animations'
export default {
data() {
return {
project: null
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
rightToLeftAnimation(this.$gsap)
//
new SimpleLightbox('.details-project-page .lightBoxImages a')
$('#slides').slick({
autoplay: true,
accessibility: false,
arrows: false,
dots: false,
rtl: this.$route.params.lang === 'fa'
// infinite: true,
// speed: 500,
// fade: true,
// cssEase: "linear",
})
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-Img-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
async asyncData({ $axios, params, error }) {
try {
const project = await $axios.get(`/api/public/project/${params.project}`)
return {
project: project.data
}
} catch (e) {
error({ status: 404, message: 'page not found' })
}
},
computed: {
content() {
return this.$store.state.content.detailsProject[this.$route.params.lang]
}
}
}
</script>
+261
View File
@@ -0,0 +1,261 @@
<template>
<div class="project-page page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section Categories ------------------------------------->
<section class="categories">
<div class="container">
<div class="row">
<div class="col-12">
<nav>
<ul>
<nuxt-link
class="all-categories"
:to="{ name: 'lang-projects', params: { lang: $route.params.lang }, query: { category: 'all' } }"
tag="li"
>
<a :class="$route.query.category === 'all' ? 'active' : null">{{ content.s2.t9 }}</a>
</nuxt-link>
<nuxt-link
v-for="item in projectCat"
:key="item.id"
class="all-categories"
:to="{ name: 'lang-projects', params: { lang: $route.params.lang }, query: { category: item._id } }"
tag="li"
>
<a :class="$route.query.category === item.id ? 'active' : null">{{ categoryName(item._id) }}</a>
</nuxt-link>
<!-- <pre>{{ projectCat }}</pre>-->
<!-- :class="filter === false ? 'active' : null"-->
<!-- >{{ content.s2.t9 }}</p>-->
<!-- </li>-->
<!-- <li-->
<!-- class="all-categories"-->
<!-- v-for="item in projectCat"-->
<!-- :key="item.id"-->
<!-- @click="filter = item.id"-->
<!-- >-->
<!-- <p-->
<!-- :class="filter === item.id ? 'active' : null">-->
<!-- {{-->
<!-- categoryName(item.id)-->
<!-- }}-->
<!-- </p>-->
<!-- </li>-->
</ul>
</nav>
</div>
</div>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<section class="s2-BG section">
<div class="parallax">
<div class="container">
<!-- <pre>{{projects}}</pre>-->
<!-- <div class="row" v-if="projects.length > 0">-->
<!-- <div class="col-12 mb-2 anim-fadeIn paddingCol" v-for="(item , index) in projects" :key="item._id">-->
<!-- <div class="row" :class="index%2 ? 'reverse' : null">-->
<!-- <div class="col-12 col-sm-12 col-md-12 col-lg-6 paddingCol ">-->
<!-- <div class="s2-img">-->
<!-- <img :src="item.thumb" :alt="item.locale[$route.params.lang].title"/>-->
<!-- </div>-->
<!-- </div>-->
<!-- <div class="col-12 col-sm-12 col-md-12 col-lg-4 d-flex align-items-center paddingCol">-->
<!-- <div class="s2-item">-->
<!-- <h6 class="h6">{{ item.locale[$route.params.lang].title }}</h6>-->
<!-- <p>{{ item.category.locale[$route.params.lang].title }}</p>-->
<!-- <span>{{ item.locale[$route.params.lang].short_description }}</span>-->
<!-- <nuxt-link :to="{name: 'lang-projects-project',params: {lang: $route.params.lang,project: item.locale[$route.params.lang].title}}" class="s2-reading">-->
<!-- <p>{{ content.s2.t1 }}</p>-->
<!-- <i class="fas" :class="$route.params.lang === 'en' ? 'fa-arrow-right' : 'fa-arrow-left'"></i>-->
<!-- </nuxt-link>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<!-- </div>-->
<div class="filterTableByTags" v-if="currentCategory">
<div class="tag" :class="activeTag === 'all' && 'active'" @click="activeTag = 'all'">
<span>{{ $route.params.lang === 'en' ? 'All' : 'همه' }}</span>
</div>
<div
class="tag"
v-for="tag in currentCategory.tags"
:key="tag._id"
:class="activeTag === tag._id && 'active'"
@click="activeTag = tag._id"
>
<span>{{ tag.locale[$route.params.lang].name }}</span>
</div>
</div>
<el-table :data="filteredProjects" class="s2-table">
<el-table-column type="index" width="80" label="#"> </el-table-column>
<el-table-column :label="content.s2.t3" :prop="`locale[${$route.params.lang}].title`" width="500">
</el-table-column>
<el-table-column :label="content.s2.t4" width="200">
<template slot-scope="scope">
{{ scope.row.locale[$route.params.lang].client || '-' }}
</template>
</el-table-column>
<el-table-column :label="content.s2.t5">
<template slot-scope="scope">
{{ jDate(scope.row.project_date) }}
</template>
</el-table-column>
<el-table-column :label="content.s2.t10">
<template slot-scope="scope">
{{ scope.row.locale[$route.params.lang].size || '-' }}
</template>
</el-table-column>
<el-table-column :label="content.s2.t11">
<template slot-scope="scope">
{{ scope.row.locale[$route.params.lang].area || '-' }}
</template>
</el-table-column>
<el-table-column :label="content.s2.t6" width="140">
<template slot-scope="scope">
<nuxt-link
v-if="scope.row.has_details"
class="btn btn-primary s2-table-btn"
:to="{ name: 'lang-projects-project', params: { lang: $route.params.lang, project: scope.row._id } }"
>
{{ content.s2.t7 }}
</nuxt-link>
<a class="btn btn-primary s2-table-disable" :title="content.s2.t8" v-else>{{ content.s2.t7 }}</a>
</template>
</el-table-column>
</el-table>
</div>
</div>
</section>
</div>
</template>
<script>
import {
fadeInAnimation,
fadeInStaggerAnimation,
leftToRightAnimation,
leftToRightStaggerAnimation,
numberAnimation,
progressAnimation,
rightToLeftAnimation
} from '@/utils/animations'
import moment from 'moment-jalaali'
export default {
data() {
return {
projects: null,
projectCat: null,
activeTag: 'all',
cover: null,
defaultCover: '/img/GalleryPage/page-title.png'
// filter: this.$route.query.category
}
},
mounted() {
this.$nextTick(() => {
fadeInAnimation(this.$gsap)
leftToRightAnimation(this.$gsap)
fadeInStaggerAnimation(this.$gsap)
leftToRightStaggerAnimation(this.$gsap)
numberAnimation(this.$gsap)
progressAnimation(this.$gsap)
rightToLeftAnimation(this.$gsap)
//--------------------------------------------------------- Section 1
this.$gsap
.timeline({
scrollTrigger: {
trigger: '.s2-BG',
scrub: true,
start: 'top top'
}
})
.to($('.s1-Img-BG .parallax'), {
duration: 9,
opacity: 0,
y: '50%'
})
})
},
async asyncData({ $axios, error }) {
try {
const projects = await $axios.get(`/api/public/projects`)
const projectCat = await $axios.get('/api/public/projectCategories')
const cover = await $axios.get('/api/public/cover')
return {
projects: projects.data,
projectCat: projectCat.data,
cover: cover.data.contact
}
} catch (e) {
error({ status: 500, message: 'there is a problem here' })
}
},
computed: {
content() {
return this.$store.state.content.projects[this.$route.params.lang]
},
currentCategory() {
return this.projectCat.find(item => item._id === this.categoryId)
},
categoryId() {
return this.$route.query?.category
},
filteredProjects() {
if (this.categoryId === 'all') return this.projects
const projectsByCat = this.projects.filter(item => item.category._id === this.categoryId)
// check tag
if (this.activeTag === 'all') return projectsByCat
return projectsByCat.filter(item => item.tag === this.activeTag)
}
},
watch: {
categoryId(newVal, oldVal) {
this.activeTag = 'all'
// this.$nuxt.refresh()
}
},
methods: {
categoryName(id) {
return this.projectCat.filter(item => item._id === id)[0].locale[this.$route.params.lang].name
},
jDate(date) {
let m = moment(date, 'jYYYY')
if (this.$route.params.lang === 'fa') return date
else return m.format('YYYY')
}
}
}
</script>
<style scoped>
.reverse {
flex-direction: row-reverse;
}
</style>
+31
View File
@@ -0,0 +1,31 @@
<template>
<div class="pwa--page">
<!-- sheet calculation module -->
<section>
<div class="section-title">
<h2>{{ content.s10.t1 }}</h2>
</div>
<SheetWCM />
</section>
<!-- pipe calculation module -->
<section class="mt-5">
<div class="section-title">
<h2>{{ content.s10.t8 }}</h2>
</div>
<PipeWCM />
</section>
</div>
</template>
<script>
export default {
name: 'PwaPage',
layout: 'pwa',
computed: {
content() {
return this.$store.state.content.home[this.$route.params.lang]
}
}
}
</script>
+103
View File
@@ -0,0 +1,103 @@
<template>
<div class="search_page">
<!---------------------------------- Section 1 ------------------------------------->
<section class="s1-Img-BG">
<div
class="parallax"
:style="{
background: `linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),url(${cover ? cover : defaultCover})`
}"
>
<h1 class="h1 anim-fadeIn" :style="{ color: $route.params.lang === 'fa' && '#fff' }">{{ content.s1.t1 }}</h1>
</div>
</section>
<!---------------------------------- Section 2 ------------------------------------->
<div class="s2">
<div class="container">
<div class="row">
<div class="col-12 view-items" v-if="blogs.length">
<h2>{{ content.s2.t1 }}</h2>
<nuxt-link
:to="{
name: 'lang-blog-post',
params: { lang: $route.params.lang, post: item.locale[$route.params.lang].title }
}"
class="view-item"
v-for="item in blogs"
:key="item._id"
>
<i class="fa-solid fa-circle-check"></i>
<p>{{ item.locale[$route.params.lang].title }}</p>
</nuxt-link>
</div>
<div class="col-12 view-items" v-if="categoryGallery.length">
<h2>{{ content.s2.t2 }}</h2>
<nuxt-link
:to="{ name: 'lang-gallery-images', params: { lang: $route.params.lang, images: item._id } }"
class="view-item"
v-for="item in categoryGallery"
:key="item._id"
>
<i class="fa-solid fa-circle-check"></i>
<p>{{ item.locale[$route.params.lang].title }}</p>
</nuxt-link>
</div>
<div class="col-12 view-items" v-if="projects.length">
<h2>{{ content.s2.t3 }}</h2>
<nuxt-link
:to="{ name: 'lang-projects', params: { lang: $route.params.lang }, query: { category: 'all' } }"
class="view-item"
v-for="item in projects"
:key="item._id"
>
<i class="fas fa-circle-check"></i>
<p>{{ item.locale[$route.params.lang].title }}</p>
</nuxt-link>
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
blogs: [],
categoryGallery: [],
projects: [],
defaultCover: '/img/GalleryPage/page-title.png'
}
},
computed: {
content() {
return this.$store.state.content.search[this.$route.params.lang]
},
cover() {
return this.$store.state.global.cover?.contact
}
},
async asyncData({ $axios, query }) {
console.log('query', query)
try {
const search = await $axios.post(`/api/public/search?terms=${query.terms}`)
return {
blogs: search.data.blogs,
categoryGallery: search.data.categoryGallery,
projects: search.data.projects
}
} catch (e) {
console.log('------e', e)
}
}
}
</script>
<style scoped></style>
+136
View File
@@ -0,0 +1,136 @@
<template>
<CRow class="justify-content-center">
<CCol lg="5">
<CCardGroup>
<CCard class="p-4">
<CCardBody>
<CForm @submit.prevent="doLogin">
<h1 class="text-muted text-center mb-5">پنل مدیریت اُریس اوکسین</h1>
<CInput
:class="validation.username ? 'err' : null"
placeholder="نام کاربری"
:description="validation.username ? validation.username.msg : null"
autocomplete="username email"
v-model="login.username"
>
<template #prepend-content>
<CIcon name="cil-user"/>
</template>
</CInput>
<div class="butt">
<CInput
:class="validation.password ? 'err' : null"
placeholder="کلمه عبور"
:type="passwordState"
:description="validation.password ? validation.password.msg : null"
autocomplete="curent-password"
v-model="login.password"
>
<template #prepend-content>
<CIcon name="cil-lock-locked"/>
</template>
</CInput>
<i @click="showPass = !showPass" class="far fa-eye"></i>
</div>
<CInputCheckbox label="مرا به خاطر بسپار" @update:checked="val => login.remember_me = val"/>
<p class="text-muted mt-3" style="font-size: 11px;">*درصورتی که گزیه "مرا به خاطر بسپار" را فعال نکنید بعد از 1 ساعت باید دوباره وارد سیستم شوید.</p>
<CRow>
<CCol col="12" class="text-right mt-2">
<CButton color="primary" type="submit" class="px-4">ورود</CButton>
</CCol>
<!-- <CCol col="6" class="text-right">-->
<!-- <CButton color="link" class="px-0">Forgot password?</CButton>-->
<!-- <CButton color="link" class="d-lg-none">Register now!</CButton>-->
<!-- </CCol>-->
</CRow>
</CForm>
</CCardBody>
</CCard>
<!-- <CCard-->
<!-- color="primary"-->
<!-- text-color="white"-->
<!-- class="text-center py-5 d-md-down-none"-->
<!-- body-wrapper>-->
<!-- <CCardBody>-->
<!-- <h2>Sign up</h2>-->
<!-- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>-->
<!-- <CButton-->
<!-- color="light"-->
<!-- variant="outline"-->
<!-- size="lg"-->
<!-- >-->
<!-- Register Now!-->
<!-- </CButton>-->
<!-- </CCardBody>-->
<!-- </CCard>-->
</CCardGroup>
</CCol>
</CRow>
</template>
<script>
export default {
data() {
return {
showPass: false,
login: {
username: '',
password: '',
remember_me: false
},
validation: {}
}
},
computed: {
passwordState() {
return this.showPass ? "text" : "password"
}
},
methods: {
doLogin() {
this.validation = {}
this.$auth.loginWith('local', {
data: this.login
})
.then(response => {
window.location.replace('/admin')
})
.catch(err => {
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
}
},
layout: 'admin-auth'
}
</script>
<style lang="scss">
.butt {
position: relative;
i {
position: absolute;
left: 7px;
top: 11px;
z-index: 3;
cursor: pointer;
color: rgba(#000, 0.5);
-webkit-transition: 0.2s;
-moz-transition: 0.2s;
-ms-transition: 0.2s;
-o-transition: 0.2s;
transition: 0.2s;
&:hover {
color: #000;
}
}
}
</style>
+156
View File
@@ -0,0 +1,156 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-blog-categories'}">برگشت به صفحه قبل</CButton>
<CButton v-if="$route.params.category === 'new'" size="sm" color="success" class="mr-1" @click="post">افزودن</CButton>
<CButton v-else size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>
</CustomSubHeader>
<CRow>
<CCol lg="6">
<CCard>
<CCardBody>
<CForm>
<CRow>
<CCol sm="12">
<CInput
:class="validation.fa_title ? 'err' : null"
label="عنوان فارسی"
:description="validation.fa_title ? validation.fa_title.msg : null"
v-model="blogCategory.locale.fa.title"
/>
<CInput
:class="validation.fa_description ? 'err' : null"
label="توضیح فارسی"
:description="validation.fa_description ? validation.fa_description.msg : null"
v-model="blogCategory.locale.fa.description"
/>
<el-divider></el-divider>
<CInput
:class="validation.en_title ? 'err' : null"
label="عنوان انگلیسی"
:description="validation.en_title ? validation.en_title.msg : null"
v-model="blogCategory.locale.en.title"
/>
<CInput
:class="validation.en_description ? 'err' : null"
label="توضیح انگلیسی"
:description="validation.en_description ? validation.en_description.msg : null"
v-model="blogCategory.locale.en.description"
/>
</CCol>
</CRow>
</CForm>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
export default {
data() {
return {
blogCategory: null,
validation: {}
}
},
computed: {
title() {
return this.$route.params.category === 'new' ? 'افزودن دسته بندی' : 'مشاهده دسته بندی'
}
},
methods: {
post() {
this.validation = {}
const data = {
fa_title: this.blogCategory.locale.fa.title,
en_title: this.blogCategory.locale.en.title,
fa_description: this.blogCategory.locale.fa.description,
en_description: this.blogCategory.locale.en.description
}
this.$axios.post(`/api/admin/blogCategory`, data)
.then(response => {
this.$message({
type: 'success',
message: 'دسته بندی با موفقیت ایجاد شد.'
})
this.$router.push({name: 'admin-blog-categories'})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
},
update() {
this.validation = {}
const data = {
fa_title: this.blogCategory.locale.fa.title,
en_title: this.blogCategory.locale.en.title,
fa_description: this.blogCategory.locale.fa.description,
en_description: this.blogCategory.locale.en.description
}
this.$axios.put(`/api/admin/blogCategory/${this.blogCategory._id}`, data)
.then(response => {
this.$message({
type: 'success',
message: 'اطلاعات بروزرسانی شد.'
})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
if (params.category !== 'new') {
const blogCategory = await $axios.get(`/api/admin/blogCategory/${params.category}`)
return {
blogCategory: blogCategory.data
}
} else {
return {
blogCategory: {
locale: {
fa: {
title: '',
description: ''
},
en: {
title: '',
description: ''
}
}
}
}
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+120
View File
@@ -0,0 +1,120 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="success" :to="{name: 'admin-blog-categories-category',params:{category: 'new'}}" class="mr-auto">افزودن</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<el-table
:data="blogCategories"
style="width: 100%">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
prop="locale.fa.title"
label="عنوان فارسی"
width="">
</el-table-column>
<el-table-column
prop="locale.en.title"
label="عنوان انگلیسی"
width="">
</el-table-column>
<el-table-column
label="ویرایش"
width="110"
align="center">
<template slot-scope="scope">
<CButton color="danger" variant="outline" :key="scope.row._id + Math.random()" @click="remove(scope.row._id)">
<i class="far fa-trash-alt"></i>
</CButton>
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-blog-categories-category',params: {category: scope.row._id}}">
<i class="far fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست دسته بندی ها',
list_title: 'لیست',
blogCategories: null
}
},
methods: {
remove(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/blogCategory/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'دسته بندی با موفقیت حذف شد'
})
this.blogCategories = this.blogCategories.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const blogCategories = await $axios.get(`/api/public/blogCategories`)
return {
blogCategories: blogCategories.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>
+276
View File
@@ -0,0 +1,276 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-blog-posts'}">برگشت به صفحه قبل</CButton>
<CButton size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>
</CustomSubHeader>
<CRow>
<CCol lg="12">
<CCard>
<CCardBody>
<CForm>
<CRow>
<CCol sm="12">
<p>دسته بندی</p>
<el-select v-model="blogPost.category" filterable :class="validation.category? 'err' : null">
<el-option v-for="item in blogCategories" :label="item.locale.fa.title" :value="item._id" :key="item._id"/>
</el-select>
<p class="text-danger" v-if="validation.category">{{ validation.category.msg }}</p>
<el-divider></el-divider>
</CCol>
<div>
<el-checkbox v-model="blogPost.published" label="پست منتشر شود"/>
</div>
</CRow>
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<h4>فارسی</h4>
<el-divider></el-divider>
<CInput
:class="validation.fa_title ? 'err' : null"
label="عنوان فارسی"
:description="validation.fa_title ? validation.fa_title.msg : null"
v-model="blogPost.locale.fa.title"
/>
<CTextarea
:class="validation.fa_short_description ? 'err' : null"
label="توضیح کوتاه فارسی"
:description="validation.fa_short_description ? validation.fa_short_description.msg : null"
v-model="blogPost.locale.fa.short_description"
/>
<CInput
:class="validation.fa_last_section_image_title ? 'err' : null"
label="عنوان روی تصویر بخش آخر"
:description="validation.fa_last_section_image_title ? validation.fa_last_section_image_title.msg : null"
v-model="blogPost.locale.fa.last_section_image_title"
/>
<CTextarea
:class="validation.fa_last_section_image_description ? 'err' : null"
label="توضیحات روی تصویر بخش آخر"
:description="validation.fa_last_section_image_description ? validation.fa_last_section_image_description.msg : null"
v-model="blogPost.locale.fa.last_section_image_description"
/>
<CInput
:class="validation.fa_last_section_title ? 'err' : null"
label="عنوان زیر تصویر بخش آخر"
:description="validation.fa_last_section_title ? validation.fa_last_section_title.msg : null"
v-model="blogPost.locale.fa.last_section_title"
/>
<CTextarea
:class="validation.fa_last_section_description ? 'err' : null"
label="توضیحات زیر تصویر بخش آخر"
:description="validation.fa_last_section_description ? validation.fa_last_section_description.msg : null"
v-model="blogPost.locale.fa.last_section_description"
/>
<client-only>
<p>توضیحات فارسی</p>
<ckeditor v-model="blogPost.locale.fa.description" :config="editorConfigFa"></ckeditor>
<p class="text-danger" v-if="validation.fa_description">{{ validation.fa_description.msg }}</p>
</client-only>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<h4>انگلیسی</h4>
<el-divider></el-divider>
<CInput
:class="validation.en_title ? 'err' : null"
label="عنوان انگلیسی"
:description="validation.en_title ? validation.en_title.msg : null"
v-model="blogPost.locale.en.title"
/>
<CTextarea
:class="validation.en_short_description ? 'err' : null"
label="توضیح کوتاه انگلیسی"
:description="validation.en_short_description ? validation.en_short_description.msg : null"
v-model="blogPost.locale.en.short_description"
/>
<CInput
:class="validation.en_last_section_image_title ? 'err' : null"
label="عنوان روی تصویر بخش آخر"
:description="validation.en_last_section_image_title ? validation.en_last_section_image_title.msg : null"
v-model="blogPost.locale.en.last_section_image_title"
/>
<CTextarea
:class="validation.en_last_section_image_description ? 'err' : null"
label="توضیحات روی تصویر بخش آخر"
:description="validation.en_last_section_image_description ? validation.en_last_section_image_description.msg : null"
v-model="blogPost.locale.en.last_section_image_description"
/>
<CInput
:class="validation.en_last_section_title ? 'err' : null"
label="عنوان زیر تصویر بخش آخر"
:description="validation.en_last_section_title ? validation.en_last_section_title.msg : null"
v-model="blogPost.locale.en.last_section_title"
/>
<CTextarea
:class="validation.en_last_section_description ? 'err' : null"
label="توضیحات زیر تصویر بخش آخر"
:description="validation.en_last_section_description ? validation.en_last_section_description.msg : null"
v-model="blogPost.locale.en.last_section_description"
/>
<client-only>
<p>توضیحات انگلیسی</p>
<ckeditor v-model="blogPost.locale.en.description" :config="editorConfigEn"></ckeditor>
<p class="text-danger" v-if="validation.en_description">{{ validation.en_description.msg }}</p>
</client-only>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<p>کاور</p>
<img :src="blogPost.cover" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="cover" @change="preview">
<p class="text-danger" v-if="validation.cover">{{ validation.cover.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<p>تصویر بخش آخر</p>
<img :src="blogPost.last_section_image" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="last_section_image" @change="preview2">
<p class="text-danger" v-if="validation.last_section_image">{{ validation.last_section_image.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<CCol lg="12">
<CCard>
<CCardBody>
<p>آپلود ویدیو</p>
<input type="file" ref="video" placeholder="انتخاب فایل ویدیو"/>
<p class="text-danger" v-if="validation.last_section_image">{{ validation.last_section_image.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<CCol lg="12" v-if="blogPost.video">
<CCard>
<CCardBody>
<video class="mt-3" width="100%" height="400" muted controls
:src="blogPost.video"></video>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
import axiosUploadProcess from "@/mixins/axiosUploadProcess"
export default {
data() {
return {
title: 'مشاهده پست',
blogPost: null,
blogCategories: null,
editorConfigFa: {
language: 'en',
extraPlugins: ['bidi', 'justify']
},
editorConfigEn: {
language: 'en',
extraPlugins: ['bidi', 'justify']
},
validation: {}
}
},
mixins: [axiosUploadProcess],
methods: {
preview() {
this.blogPost.cover = URL.createObjectURL(event.target.files[0])
},
preview2() {
this.blogPost.last_section_image = URL.createObjectURL(event.target.files[0])
},
update() {
this.validation = {}
const data = new FormData()
data.append('fa_title', this.blogPost?.locale?.fa?.title || '')
data.append('en_title', this.blogPost?.locale?.en?.title || '')
data.append('fa_description', this.blogPost?.locale?.fa?.description || '')
data.append('en_description', this.blogPost?.locale?.en?.description || '')
data.append('fa_short_description', this.blogPost?.locale?.fa?.short_description || '')
data.append('en_short_description', this.blogPost?.locale?.en?.short_description || '')
data.append('fa_last_section_image_title', this.blogPost?.locale?.fa?.last_section_image_title || '')
data.append('en_last_section_image_title', this.blogPost?.locale?.en?.last_section_image_title || '')
data.append('fa_last_section_image_description', this.blogPost?.locale?.fa?.last_section_image_description || '')
data.append('en_last_section_image_description', this.blogPost?.locale?.en?.last_section_image_description || '')
data.append('fa_last_section_title', this.blogPost?.locale?.fa?.last_section_title || '')
data.append('en_last_section_title', this.blogPost?.locale?.en?.last_section_title || '')
data.append('fa_last_section_description', this.blogPost?.locale?.fa?.last_section_description || '')
data.append('en_last_section_description', this.blogPost?.locale?.en?.last_section_description || '')
data.append('category', this.blogPost.category)
data.append('published', this.blogPost.published)
console.log(this.$refs)
if (this.$refs.cover.files[0]) data.append('cover', this.$refs.cover.files[0])
if (this.$refs.last_section_image.files[0]) data.append('last_section_image', this.$refs.last_section_image.files[0])
if (this.$refs?.video?.files[0]) data.append('video', this.$refs?.video?.files[0])
this.$axios.put(`/api/admin/blogPost/${this.blogPost._id}`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'اطلاعات بروزرسانی شد.'
})
this.$refs.cover.value = null
this.$refs.last_section_image.value = null
this.$nuxt.refresh()
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
this.$message({
type: 'error',
message: 'پارامتر هارو بررسی کنید'
})
} else console.log(err.response.data)
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
const blogCategories = await $axios.get(`/api/public/blogCategories`)
const blogPost = await $axios.get(`/api/public/blogPost/${params.post}?noCategory=true`)
return {
blogCategories: blogCategories.data,
blogPost: blogPost.data
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+141
View File
@@ -0,0 +1,141 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="success" :to="{name: 'admin-blog-posts-new'}" class="mr-auto">افزودن</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<CRow>
<CCol>
<el-table
:data="blogPosts"
style="width: 100%">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
label="کاور"
width="200">
<template slot-scope="scope">
<img :src="scope.row.thumb" alt="" style="width: 100%">
</template>
</el-table-column>
<el-table-column
prop="locale.fa.title"
label="عنوان فارسی"
width="">
</el-table-column>
<el-table-column
prop="locale.en.title"
label="عنوان انگلیسی"
width="">
</el-table-column>
<el-table-column
label="وضعیت انتشار پست"
>
<template slot-scope="scope">
<span class="text-success" v-if="scope.row.published">منتشر شده</span>
<span class="text-danger" v-else>منتشر نشده</span>
</template>
</el-table-column>
<el-table-column
label="ویرایش"
width="110"
align="center">
<template slot-scope="scope">
<CButton color="danger" variant="outline" :key="scope.row._id + Math.random()" @click="remove(scope.row._id)">
<i class="far fa-trash-alt"></i>
</CButton>
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-blog-posts-post',params: {post: scope.row._id}}">
<i class="far fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCol>
</CRow>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست پست های رویدادها',
list_title: 'لیست',
blogPosts: null
}
},
methods: {
remove(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/blogPost/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'پست با موفقیت حذف شد'
})
this.blogPosts = this.blogPosts.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const blogPosts = await $axios.get(`/api/public/blogPosts?getAll=true`)
return {
blogPosts: blogPosts.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>
+114
View File
@@ -0,0 +1,114 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-blog-posts'}">برگشت به صفحه قبل</CButton>
<CButton size="sm" color="success" class="mr-1" @click="post">افزودن</CButton>
</CustomSubHeader>
<CRow>
<CCol lg="6">
<CCard>
<CCardBody>
<CForm>
<CRow>
<CCol sm="12">
<CInput
:class="validation.fa_title ? 'err' : null"
label="عنوان فارسی"
:description="validation.fa_title ? validation.fa_title.msg : null"
v-model="fa_title"
/>
<CInput
:class="validation.en_title ? 'err' : null"
label="عنوان انگلیسی"
:description="validation.en_title ? validation.en_title.msg : null"
v-model="en_title"
/>
</CCol>
</CRow>
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<p>کاور</p>
<img :src="cover" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="cover" @change="preview">
<p class="text-danger" v-if="validation.cover">{{ validation.cover.msg }}</p>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
import axiosUploadProcess from "@/mixins/axiosUploadProcess"
export default {
data() {
return {
title: 'افزودن پست',
fa_title: '',
en_title: '',
cover: '',
blogCategories: null,
editorConfig: {
language: 'en',
extraPlugins: ['bidi', 'justify']
},
validation: {}
}
},
mixins: [axiosUploadProcess],
methods: {
preview() {
this.cover = URL.createObjectURL(event.target.files[0])
},
post() {
this.validation = {}
const data = new FormData()
data.append('fa_title', this.fa_title)
data.append('en_title', this.en_title)
data.append('cover', this.$refs.cover.files[0])
this.$axios.post(`/api/admin/blogPost`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'پست با موفقیت ایجاد شد.'
})
this.$router.push({name: 'admin-blog-posts-post', params: {post: response.data._id}})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
return this.$message({
type: 'warning',
message: 'پارامتر ها رو بررسی و دوباره تلاش کنید'
})
} else console.log(err.response.data)
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin'
}
</script>
+194
View File
@@ -0,0 +1,194 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-catalogs'}">برگشت به صفحه قبل</CButton>
<CButton v-if="$route.params.catalog === 'new'" size="sm" color="success" class="mr-1" @click="post">افزودن</CButton>
<CButton v-else size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>
</CustomSubHeader>
<CRow>
<CCol lg="6">
<CCard>
<CCardBody>
<CInput
:class="validation.fa_title ? 'err' : null"
label="عنوان فارسی"
:description="validation.fa_title ? validation.fa_title.msg : null"
v-model="catalog.locale.fa.title"
/>
<CInput
:class="validation.en_title ? 'err' : null"
label="عنوان انگلیسی"
:description="validation.en_title ? validation.en_title.msg : null"
v-model="catalog.locale.en.title"
/>
<div>
<el-checkbox v-model="catalog.showInFa" label="در نسخه فارسی سایت نمایش داده شود"/>
</div>
<div>
<el-checkbox v-model="catalog.showInEn" label="در نسخه انگلیسی سایت نمایش داده شود"/>
</div>
<el-divider></el-divider>
<p>فایل کاتلوگ:</p>
<input type="file" ref="file">
<p class="text-danger" v-if="validation.file">{{ validation.file.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<p>تصویر</p>
<img :src="catalog.cover" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="cover" @change="preview">
<p class="text-danger" v-if="validation.cover">{{ validation.cover.msg }}</p>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
import axiosUploadProcess from "@/mixins/axiosUploadProcess"
export default {
data() {
return {
catalog: null,
validation: {}
}
},
computed: {
title() {
return this.$route.params.image === 'new' ? 'افزودن کاتالوگ جدید' : 'ویرایش کاتالوگ'
}
},
mixins: [axiosUploadProcess],
methods: {
preview() {
this.catalog.cover = URL.createObjectURL(event.target.files[0])
},
post() {
this.validation = {}
if (!this.$refs.file.files[0]) {
return this.$message({
type: 'error',
message: 'فایل کاتالوگ اجباری میباشد'
})
}
if (!this.$refs.cover.files[0]) {
return this.$message({
type: 'error',
message: 'کاور اجباری میباشد'
})
}
const data = new FormData()
data.append('fa_title', this.catalog.locale.fa.title)
data.append('en_title', this.catalog.locale.en.title)
data.append('showInFa', this.catalog.showInFa)
data.append('showInEn', this.catalog.showInEn)
data.append('file', this.$refs.file.files[0])
data.append('cover', this.$refs.cover.files[0])
this.$axios.post(`/api/admin/catalog`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'کاتالوگ با موفقیت افزوده شد'
})
this.$router.push({name: 'admin-catalogs'})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
this.$message({
type: 'error',
message: 'پارامتر هارو بررسی کنید'
})
} else console.log(err.response.data)
})
},
update() {
this.validation = {}
const data = new FormData()
data.append('fa_title', this.catalog.locale.fa.title)
data.append('en_title', this.catalog.locale.en.title)
data.append('showInFa', this.catalog.showInFa)
data.append('showInEn', this.catalog.showInEn)
if (this.$refs.file.files[0]) data.append('file', this.$refs.file.files[0])
if (this.$refs.cover.files[0]) data.append('cover', this.$refs.cover.files[0])
this.$axios.put(`/api/admin/catalog/${this.catalog._id}`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'اطلاعات بروزرسانی شد.'
})
this.$refs.cover.value = null
this.$refs.file.value = null
this.$nuxt.refresh()
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
this.$message({
type: 'error',
message: 'پارامتر هارو بررسی کنید'
})
} else console.log(err.response.data)
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
if (params.catalog !== 'new') {
const catalog = await $axios.get(`/api/public/catalog/${params.catalog}`)
return {
catalog: catalog.data
}
} else {
return {
catalog: {
locale: {
fa: {
title: ''
},
en: {
title: ''
}
},
file: '',
cover: '',
showInFa: true,
showInEn: false
}
}
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+143
View File
@@ -0,0 +1,143 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="success" :to="{name: 'admin-catalogs-catalog',params: {catalog: 'new'}}" class="mr-auto">افزودن</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<CRow>
<CCol>
<el-table
:data="catalogs"
style="width: 100%">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
label="عکس"
width="200">
<template slot-scope="scope">
<img :src="scope.row.cover" alt="" style="width: 100%">
</template>
</el-table-column>
<el-table-column
prop="locale.fa.title"
label="عنوان فارسی"
width="">
</el-table-column>
<el-table-column
prop="locale.en.title"
label="عنوان انگلیسی"
width="">
</el-table-column>
<el-table-column
label="حالت نمایش"
width="">
<template slot-scope="scope">
<b class="text-success" v-if="scope.row.showInFa && scope.row.showInEn">فارسی و انگلیسی</b>
<b class="text-danger" v-if="!scope.row.showInFa && !scope.row.showInEn">نمایش داده نشود</b>
<b class="text-warning" v-if="!scope.row.showInEn && scope.row.showInFa">فارسی</b>
<b class="text-warning" v-if="!scope.row.showInFa && scope.row.showInEn">انگلیسی</b>
</template>
</el-table-column>
<el-table-column
label="ویرایش"
width="110"
align="center">
<template slot-scope="scope">
<CButton color="danger" variant="outline" :key="scope.row._id + Math.random()" @click="remove(scope.row._id)">
<i class="far fa-trash-alt"></i>
</CButton>
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-catalogs-catalog',params: {catalog: scope.row._id}}">
<i class="far fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCol>
</CRow>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست کاتالوگ ها',
list_title: 'لیست',
catalogs: null
}
},
methods: {
remove(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/catalog/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'کاتالوگ با موفقیت حذف شد'
})
this.catalogs = this.catalogs.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const catalogs = await $axios.get(`/api/public/catalogs`)
return {
catalogs: catalogs.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>
+206
View File
@@ -0,0 +1,206 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-comments'}">برگشت به صفحه قبل</CButton>
<CButton v-if="$route.params.comment === 'new'" size="sm" color="success" class="mr-1" @click="post">افزودن</CButton>
<CButton v-else size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>
</CustomSubHeader>
<CRow>
<CCol lg="6">
<CCard>
<CCardBody>
<CForm>
<h4 class="mt-5">فارسی</h4>
<el-divider></el-divider>
<CInput
:class="validation.fa_name ? 'err' : null"
label="نام فارسی"
:description="validation.fa_name ? validation.fa_name.msg : null"
v-model="comment.locale.fa.name"
/>
<CInput
:class="validation.fa_position ? 'err' : null"
label="سمت فارسی"
:description="validation.fa_position ? validation.fa_position.msg : null"
v-model="comment.locale.fa.position"
/>
<CTextarea
:class="validation.fa_comment ? 'err' : null"
label="کامنت فارسی"
:description="validation.fa_comment ? validation.fa_comment.msg : null"
v-model="comment.locale.fa.comment"
/>
<h4 class="mt-5">انگلیسی</h4>
<el-divider></el-divider>
<CInput
:class="validation.en_name ? 'err' : null"
label="نام انگلیسی"
:description="validation.en_name ? validation.en_name.msg : null"
v-model="comment.locale.en.name"
/>
<CInput
:class="validation.en_position ? 'err' : null"
label="سمت انگلیسی"
:description="validation.en_position ? validation.en_position.msg : null"
v-model="comment.locale.en.position"
/>
<CTextarea
:class="validation.en_comment ? 'err' : null"
label="کامنت انگلیسی"
:description="validation.en_comment ? validation.en_comment.msg : null"
v-model="comment.locale.en.comment"
/>
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<h2>تصویر</h2>
<el-divider></el-divider>
<img :src="comment.image" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="image" @change="preview">
<p class="text-danger" v-if="validation.image">{{ validation.image.msg }}</p>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
export default {
data() {
return {
comment: null,
validation: {}
}
},
computed: {
title() {
return this.$route.params.comment === 'new' ? 'افزودن کامنت جدید' : 'مشاهده اطلاعات کامنت'
}
},
methods: {
preview() {
this.comment.image = URL.createObjectURL(event.target.files[0])
},
post() {
this.validation = {}
const data = new FormData()
data.append('fa_name', this.comment.locale.fa.name)
data.append('en_name', this.comment.locale.en.name)
data.append('fa_position', this.comment.locale.fa.position)
data.append('en_position', this.comment.locale.en.position)
data.append('fa_comment', this.comment.locale.fa.comment)
data.append('en_comment', this.comment.locale.en.comment)
if (this.$refs.image.files[0]) data.append('image', this.$refs.image.files[0])
this.$axios.post(`/api/admin/comment`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'کامنت با موفقیت ایجاد شد.'
})
this.$router.push({name: 'admin-comments'})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
return this.$message({
type: 'warning',
message: 'پارامتر ها رو بررسی و دوباره تلاش کنید'
})
} else console.log(err.response.data)
})
},
update() {
this.validation = {}
const data = new FormData()
data.append('fa_name', this.comment.locale.fa.name)
data.append('en_name', this.comment.locale.en.name)
data.append('fa_position', this.comment.locale.fa.position)
data.append('en_position', this.comment.locale.en.position)
data.append('fa_comment', this.comment.locale.fa.comment)
data.append('en_comment', this.comment.locale.en.comment)
if (this.$refs.image.files[0]) data.append('image', this.$refs.image.files[0])
this.$axios.put(`/api/admin/comment/${this.comment._id}`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'اطلاعات بروزرسانی شد.'
})
this.$refs.image.value = null
this.$nuxt.refresh()
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
if (params.comment !== 'new') {
const team = await $axios.get(`/api/admin/comment/${params.comment}`)
return {
comment: team.data
}
} else {
return {
comment: {
locale: {
fa: {
name: '',
position: '',
comment: ''
},
en: {
name: '',
position: '',
comment: ''
}
},
image: ''
}
}
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+128
View File
@@ -0,0 +1,128 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="success" :to="{name: 'admin-comments-comment',params:{comment: 'new'}}" class="mr-auto">افزودن</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<el-table
:data="comments"
style="width: 100%">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
label="عکس"
width="200">
<template slot-scope="scope">
<img :src="scope.row.image || '/img/avatar.png'" alt="" style="width: 100%;">
</template>
</el-table-column>
<el-table-column
prop="locale.fa.name"
label="نام"
width="">
</el-table-column>
<el-table-column
prop="locale.fa.position"
label="سمت"
width="">
</el-table-column>
<el-table-column
label="ویرایش"
width="110"
align="center">
<template slot-scope="scope">
<CButton color="danger" variant="outline" :key="scope.row._id + Math.random()" @click="remove(scope.row._id)">
<i class="far fa-trash-alt"></i>
</CButton>
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-comments-comment',params: {comment: scope.row._id}}">
<i class="far fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست نظرات مشتریان',
list_title: 'لیست',
comments: null
}
},
methods: {
remove(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/comment/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'مورد با موفقیت حذف شد'
})
this.comments = this.comments.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const comments = await $axios.get(`/api/public/comments`)
return {
comments: comments.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>
@@ -0,0 +1,96 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-contact-us-messages'}">برگشت به صفحه قبل</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<!-- <i class="fal fa-bars"></i>-->
<!-- <span>{{ list_title }}</span>-->
</slot>
</CCardHeader>
<CCardBody>
<CRow>
<CCol md="6">
<CForm class="message">
<CRow>
<CCol sm="12">
<CInput
label="زبان سایت هنگام بازدید کاربر"
:value="message.locale === 'fa' ? 'فارسی' : 'انگلیسی'"
disabled
/>
<CInput
label="نام"
:value="message.name"
disabled
/>
<CInput
label="ایمیل"
:value="message.email"
disabled
/>
<CInput
label="موضوع"
:value="message.subject"
disabled
/>
<CTextarea
label="پیام"
disabled=""
:value="message.message"
rows="10"
/>
</CCol>
</CRow>
</CForm>
</CCol>
</CRow>
</CCardBody>
</CCard>
</div>
</template>
<script>
import unreadMessagesCounter from "@/mixins/unreadMessagesCounter"
export default {
data() {
return {
title: 'مشاهده پیام',
message: null,
validation: {}
}
},
mixins: [unreadMessagesCounter],
mounted() {
this.checkMessages()
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
const message = await $axios.get(`/api/admin/contactUsMessages/${params.message}`)
return {
message: message.data
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
<style lang="scss">
.message {
input:disabled, textarea:disabled {
color: #000 !important;
}
}
</style>
+137
View File
@@ -0,0 +1,137 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
</CustomSubHeader>
<CRow>
<CCol col="col">
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-filter"></i>
<span>فیلتر</span>
</slot>
</CCardHeader>
<CCardBody>
<CButtonGroup>
<CButton color="primary" :class="filter === 'all' && 'selected'" @click="filter = 'all'">همه</CButton>
<CButton color="warning" :class="filter === 'fa_unread' && 'selected'" @click="filter = 'fa_unread'">خوانده نشده فارسی</CButton>
<CButton color="warning" :class="filter === 'en_unread' && 'selected'" @click="filter = 'en_unread'">خوانده نشده انگلیسی</CButton>
<CButton color="success" :class="filter === 'fa_read' && 'selected'" @click="filter = 'fa_read'">خوانده شده فارسی</CButton>
<CButton color="success" :class="filter === 'en_read' && 'selected'" @click="filter = 'en_read'">خوانده شده انگلیسی</CButton>
</CButtonGroup>
</CCardBody>
</CCard>
</CCol>
</CRow>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<el-table
:data="filteredMessages"
style="width: 100%"
:row-class-name="readStatus">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
prop="name"
label="نام"
width="">
</el-table-column>
<el-table-column
prop="email"
label="ایمیل"
width="">
</el-table-column>
<!-- <el-table-column-->
<!-- prop="phone"-->
<!-- label="شماره تماس"-->
<!-- width=""-->
<!-- class-name="phoneNumber">-->
<!-- </el-table-column>-->
<el-table-column
label="مشاهده"
width="80"
align="center">
<template slot-scope="scope">
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-contact-us-messages-message',params: {message: scope.row._id}}">
<i class="far fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست پیغام های کاربران',
list_title: 'لیست',
messages: null,
filter: 'all'
}
},
computed: {
filteredMessages() {
const filter = this.filter
if (filter === 'all') return this.messages
else if (filter === 'fa_unread') return this.messages.filter(item => item.locale === 'fa' && !item.read)
else if (filter === 'en_unread') return this.messages.filter(item => item.locale === 'en' && !item.read)
else if (filter === 'fa_read') return this.messages.filter(item => item.locale === 'fa' && item.read)
else if (filter === 'en_read') return this.messages.filter(item => item.locale === 'en' && item.read)
}
},
methods: {
readStatus({row, rowIndex}) {
return row.read ? null : 'unread'
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const messages = await $axios.get('/api/admin/contactUsMessages')
return {
messages: messages.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>
<style lang="scss">
.phoneNumber {
div {
direction: ltr;
text-align: right;
}
}
.unread {
background: rgba(255, 173, 0, 0.12) !important;
}
</style>
+182
View File
@@ -0,0 +1,182 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-gallery'}">برگشت به صفحه قبل</CButton>
<CButton v-if="$route.params.image === 'new'" size="sm" color="success" class="mr-1" @click="post">افزودن</CButton>
<CButton v-else size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>
</CustomSubHeader>
<CRow>
<CCol lg="6">
<CCard>
<CCardBody>
<div>
<p>دسته بندی</p>
<el-select v-model="image.category" filterable :disabled="image.noCategory" :class="validation.category? 'err' : null">
<el-option v-for="item in galleryCategories" :label="item.locale.fa.title" :value="item._id" :key="item._id"/>
</el-select>
<p class="text-danger" v-if="validation.category">{{ validation.category.msg }}</p>
</div>
<div class="mt-3">
<el-checkbox v-model="image.noCategory" label="بدون دسته بندی"/>
</div>
<el-divider></el-divider>
<CInput
:class="validation.fa_caption ? 'err' : null"
label="کپشن فارسی"
:description="validation.fa_caption ? validation.fa_caption.msg : null"
v-model="image.locale.fa.caption"
/>
<CInput
:class="validation.en_caption ? 'err' : null"
label="کپشن انگلیسی"
:description="validation.en_caption ? validation.en_caption.msg : null"
v-model="image.locale.en.caption"
/>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<p>تصویر</p>
<img :src="image.image" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="image" @change="preview">
<p class="text-danger" v-if="validation.image">{{ validation.image.msg }}</p>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
import axiosUploadProcess from "@/mixins/axiosUploadProcess"
export default {
data() {
return {
galleryCategories: null,
image: null,
validation: {}
}
},
computed: {
title() {
return this.$route.params.image === 'new' ? 'افزودن تصویر جدید' : 'ویرایش تصویر'
}
},
mixins: [axiosUploadProcess],
methods: {
preview() {
this.image.image = URL.createObjectURL(event.target.files[0])
},
post() {
this.validation = {}
const data = new FormData()
data.append('fa_caption', this.image.locale.fa.caption)
data.append('en_caption', this.image.locale.en.caption)
data.append('category', this.image.category)
data.append('noCategory', this.image.noCategory)
data.append('image', this.$refs.image.files[0])
this.$axios.post(`/api/admin/gallery`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'تصویر با موفقیت افزوده شد'
})
this.$router.push({name: 'admin-gallery'})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
this.$message({
type: 'error',
message: 'پارامتر هارو بررسی کنید'
})
} else console.log(err.response.data)
})
},
update() {
this.validation = {}
const data = new FormData()
data.append('fa_caption', this.image.locale.fa.caption)
data.append('en_caption', this.image.locale.en.caption)
data.append('category', this.image.category)
data.append('noCategory', this.image.noCategory)
if (this.$refs.image.files[0]) data.append('image', this.$refs.image.files[0])
this.$axios.put(`/api/admin/gallery/${this.image._id}`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'اطلاعات بروزرسانی شد.'
})
this.$refs.image.value = null
this.$nuxt.refresh()
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
this.$message({
type: 'error',
message: 'پارامتر هارو بررسی کنید'
})
} else console.log(err.response.data)
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
const galleryCategories = await $axios.get(`/api/public/galleryCategories`)
if (params.image !== 'new') {
const image = await $axios.get(`/api/public/galleryImage/${params.image}`)
return {
galleryCategories: galleryCategories.data,
image: image.data
}
} else {
return {
galleryCategories: galleryCategories.data,
image: {
locale: {
fa: {
caption: ''
},
en: {
caption: ''
}
},
image: '',
category: '',
noCategory: false
}
}
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+142
View File
@@ -0,0 +1,142 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="success" :to="{name: 'admin-gallery-image',params: {image: 'new'}}" class="mr-auto">افزودن</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<CRow>
<CCol>
<el-table
:data="galleryImages"
style="width: 100%">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
label="عکس"
width="200">
<template slot-scope="scope">
<img :src="scope.row.thumb" alt="" style="width: 100%">
</template>
</el-table-column>
<el-table-column
label="دسته بندی"
width="">
<template slot-scope="scope">
<span v-if="!scope.row.noCategory">{{ scope.row.category.locale.fa.title }}</span>
<span v-else class="text-danger">بدون دسته بندی</span>
</template>
</el-table-column>
<el-table-column
prop="locale.fa.caption"
label="کپشن فارسی"
width="">
</el-table-column>
<el-table-column
prop="locale.en.caption"
label="کپشن انگلیسی"
width="">
</el-table-column>
<el-table-column
label="ویرایش"
width="110"
align="center">
<template slot-scope="scope">
<CButton color="danger" variant="outline" :key="scope.row._id + Math.random()" @click="remove(scope.row._id)">
<i class="far fa-trash-alt"></i>
</CButton>
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-gallery-image',params: {image: scope.row._id}}">
<i class="far fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCol>
</CRow>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست تصاویر گالری',
list_title: 'لیست',
galleryImages: null
}
},
methods: {
remove(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/gallery/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'تصویر با موفقیت حذف شد'
})
this.galleryImages = this.galleryImages.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const galleryImages = await $axios.get(`/api/public/gallery`)
return {
galleryImages: galleryImages.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>
+192
View File
@@ -0,0 +1,192 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-galleryCategories'}">برگشت به صفحه قبل</CButton>
<CButton v-if="$route.params.category === 'new'" size="sm" color="success" class="mr-1" @click="post">افزودن</CButton>
<CButton v-else size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>
</CustomSubHeader>
<CRow>
<CCol lg="6">
<CCard>
<CCardBody>
<CForm>
<CRow>
<CCol sm="12">
<CInput
:class="validation.fa_title ? 'err' : null"
label="عنوان فارسی"
:description="validation.fa_title ? validation.fa_title.msg : null"
v-model="galleryCategory.locale.fa.title"
/>
<CInput
:class="validation.fa_description ? 'err' : null"
label="توضیح فارسی"
:description="validation.fa_description ? validation.fa_description.msg : null"
v-model="galleryCategory.locale.fa.description"
/>
<el-divider></el-divider>
<CInput
:class="validation.en_title ? 'err' : null"
label="عنوان انگلیسی"
:description="validation.en_title ? validation.en_title.msg : null"
v-model="galleryCategory.locale.en.title"
/>
<CInput
:class="validation.en_description ? 'err' : null"
label="توضیح انگلیسی"
:description="validation.en_description ? validation.en_description.msg : null"
v-model="galleryCategory.locale.en.description"
/>
<span style="font-weight: 600">ترتیب نمایش</span>
<el-select v-model="galleryCategory.index" filterable style="width: 100%;margin-top: 5px;">
<el-option
v-for="item in galleryCategories.length + 20"
v-if="galleryCategories.filter(item2=>Number(item2.index) !== item+1)"
:key="item + 202"
:value="item+1"
:label="item+1"/>
</el-select>
<p v-if="validation.index" class="text-danger" style="margin-top: 5px;">{{ validation.index.msg }}</p>
</CCol>
</CRow>
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<p>کاور</p>
<img :src="galleryCategory.cover" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="cover" @change="preview">
<p class="text-danger" v-if="validation.cover">{{ validation.cover.msg }}</p>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
export default {
data() {
return {
galleryCategory: null,
galleryCategories: null,
validation: {}
}
},
computed: {
title() {
return this.$route.params.category === 'new' ? 'افزودن دسته بندی' : 'مشاهده دسته بندی'
}
},
methods: {
preview() {
this.galleryCategory.cover = URL.createObjectURL(event.target.files[0])
},
post() {
this.validation = {}
const data = new FormData()
data.append('fa_title', this.galleryCategory.locale.fa.title)
data.append('en_title', this.galleryCategory.locale.en.title)
data.append('fa_description', this.galleryCategory.locale.fa.description)
data.append('en_description', this.galleryCategory.locale.en.description)
data.append('index', this.galleryCategory.index)
if (this.$refs.cover.files[0]) data.append('cover', this.$refs.cover.files[0])
this.$axios.post(`/api/admin/galleryCategory`, data)
.then(response => {
this.$message({
type: 'success',
message: 'دسته بندی با موفقیت ایجاد شد.'
})
this.$router.push({name: 'admin-galleryCategories'})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
},
update() {
this.validation = {}
const data = new FormData()
data.append('fa_title', this.galleryCategory.locale.fa.title)
data.append('en_title', this.galleryCategory.locale.en.title)
data.append('fa_description', this.galleryCategory.locale.fa.description)
data.append('en_description', this.galleryCategory.locale.en.description)
data.append('index', this.galleryCategory.index)
if (this.$refs.cover.files[0]) data.append('cover', this.$refs.cover.files[0])
this.$axios.put(`/api/admin/galleryCategory/${this.galleryCategory._id}`, data)
.then(response => {
this.$message({
type: 'success',
message: 'اطلاعات بروزرسانی شد.'
})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
const galleryCategories = await $axios.$get(`/api/public/galleryCategories`)
if (params.category !== 'new') {
const galleryCategory = await $axios.$get(`/api/admin/galleryCategory/${params.category}`)
return {
galleryCategory,
galleryCategories,
}
} else {
return {
galleryCategories,
galleryCategory: {
locale: {
fa: {
title: '',
description: ''
},
en: {
title: '',
description: ''
}
},
index : 0
}
}
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+128
View File
@@ -0,0 +1,128 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="success" :to="{name: 'admin-galleryCategories-category',params:{category: 'new'}}" class="mr-auto">افزودن</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<el-table
:data="galleryCategories"
style="width: 100%">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
label="کاور"
width="200">
<template slot-scope="scope">
<img :src="!scope.row.thumb.includes('undefined') ? scope.row.thumb : '/img/default-img.png'" alt="" style="width: 50%">
</template>
</el-table-column>
<el-table-column
prop="locale.fa.title"
label="عنوان فارسی"
width="">
</el-table-column>
<el-table-column
prop="locale.en.title"
label="عنوان انگلیسی"
width="">
</el-table-column>
<el-table-column
label="ویرایش"
width="110"
align="center">
<template slot-scope="scope">
<CButton color="danger" variant="outline" :key="scope.row._id + Math.random()" @click="remove(scope.row._id)">
<i class="far fa-trash-alt"></i>
</CButton>
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-galleryCategories-category',params: {category: scope.row._id}}">
<i class="far fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست دسته بندی گالری تصاویر',
list_title: 'لیست',
galleryCategories: null
}
},
methods: {
remove(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/galleryCategory/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'دسته بندی با موفقیت حذف شد'
})
this.galleryCategories = this.galleryCategories.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const galleryCategories = await $axios.get(`/api/public/galleryCategories`)
return {
galleryCategories: galleryCategories.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>
+36
View File
@@ -0,0 +1,36 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<h1>به پنل مدیریت وبسایت خوش آمدید</h1>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'داشبورد',
list_title: 'لیست'
}
},
head() {
return {
title: this.title
}
},
layout: 'admin'
}
</script>
+248
View File
@@ -0,0 +1,248 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-projectCategories'}">برگشت به صفحه قبل</CButton>
<CButton v-if="$route.params.category === 'new'" size="sm" color="success" class="mr-1" @click="post">افزودن</CButton>
<CButton v-else size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>
</CustomSubHeader>
<CRow>
<CCol lg="6">
<CCard>
<CCardBody>
<CForm>
<CRow>
<CCol sm="12">
<CInput
:class="validation.fa_name ? 'err' : null"
label="عنوان فارسی"
:description="validation.fa_name ? validation.fa_name.msg : null"
v-model="projectCategory.locale.fa.name"
/>
<CInput
:class="validation.en_name ? 'err' : null"
label="عنوان انگلیسی"
:description="validation.en_name ? validation.en_name.msg : null"
v-model="projectCategory.locale.en.name"
/>
</CCol>
</CRow>
</CForm>
</CCardBody>
</CCard>
</CCol>
<!-- tags -->
<CCol v-if="$route.params.category !== 'new'" lg="6">
<CCard>
<CCardBody>
<CForm>
<CRow>
<CCol sm="12">
<h4>افزودن دسته بندی زیر مجموعه:</h4>
<el-divider></el-divider>
<CInput
:class="validation.fa_tagName ? 'err' : null"
label="عنوان فارسی"
:description="validation.fa_tagName ? validation.fa_tagName.msg : null"
v-model="tag.fa_tagName"
/>
<CInput
:class="validation.en_tagName ? 'err' : null"
label="عنوان انگلیسی"
:description="validation.en_tagName ? validation.en_tagName.msg : null"
v-model="tag.en_tagName"
/>
</CCol>
<CCol sm="12">
<el-button type="success" size="small" @click="addTag">افزودن</el-button>
</CCol>
<el-divider></el-divider>
<div>
<el-tag
v-for="tag in projectCategory.tags"
:key="tag._id"
closable
@click="removeTag(tag._id)"
style="margin-left: 10px;margin-bottom: 5px;cursor: pointer"
>
{{ tag.locale.fa.name }}
</el-tag>
</div>
</CRow>
</CForm>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
export default {
data() {
return {
projectCategory: null,
tag: {
fa_tagName: '',
en_tagName: ''
},
validation: {}
}
},
computed: {
title() {
return this.$route.params.category === 'new' ? 'افزودن دسته بندی' : 'مشاهده دسته بندی'
}
},
methods: {
post() {
this.validation = {}
const data = {
fa_name: this.projectCategory.locale.fa.name,
en_name: this.projectCategory.locale.en.name
}
this.$axios.post(`/api/admin/projectCategory`, data)
.then(response => {
this.$message({
type: 'success',
message: 'دسته بندی با موفقیت ایجاد شد.'
})
this.$router.push({name: 'admin-projectCategories'})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
},
update() {
this.validation = {}
const data = {
fa_name: this.projectCategory.locale.fa.name,
en_name: this.projectCategory.locale.en.name
}
this.$axios.put(`/api/admin/projectCategory/${this.projectCategory._id}`, data)
.then(response => {
this.$message({
type: 'success',
message: 'اطلاعات بروزرسانی شد.'
})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
},
addTag() {
this.validation = {}
const data = {
fa_tagName: this.tag.fa_tagName,
en_tagName: this.tag.en_tagName
}
this.$axios.post(`/api/admin/categoryTag/${this.projectCategory._id}`, data)
.then(response => {
this.$message({
type: 'success',
message: 'دسته بندی با موفقیت ایجاد شد.'
})
this.tag = {
fa_tagName: '',
en_tagName: ''
}
this.$nuxt.refresh()
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
},
removeTag(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/categoryTag/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'دسته بندی زیر مجموعه با موفقیت حذف شد'
})
this.$nuxt.refresh()
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
},
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
if (params.category !== 'new') {
const projectCategory = await $axios.get(`/api/admin/projectCategory/${params.category}`)
return {
projectCategory: projectCategory.data
}
} else {
return {
projectCategory: {
locale: {
fa: {
name: ''
},
en: {
name: ''
}
}
}
}
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+120
View File
@@ -0,0 +1,120 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="success" :to="{name: 'admin-projectCategories-category',params:{category: 'new'}}" class="mr-auto">افزودن</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<el-table
:data="projectCategories"
style="width: 100%">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
prop="locale.fa.name"
label="عنوان فارسی"
width="">
</el-table-column>
<el-table-column
prop="locale.en.name"
label="عنوان انگلیسی"
width="">
</el-table-column>
<el-table-column
label="ویرایش"
width="110"
align="center">
<template slot-scope="scope">
<CButton color="danger" variant="outline" :key="scope.row._id + Math.random()" @click="remove(scope.row._id)">
<i class="far fa-trash-alt"></i>
</CButton>
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-projectCategories-category',params: {category: scope.row._id}}">
<i class="far fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست دسته بندی پروژه',
list_title: 'لیست',
projectCategories: null
}
},
methods: {
remove(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/projectCategory/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'دسته بندی با موفقیت حذف شد'
})
this.projectCategories = this.projectCategories.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const projectCategories = await $axios.get(`/api/public/projectCategories`)
return {
projectCategories: projectCategories.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>
+545
View File
@@ -0,0 +1,545 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-projects'}">برگشت به صفحه قبل</CButton>
<CButton size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>
</CustomSubHeader>
<CRow>
<!-- ### category | title | description | settings ###-->
<CCol lg="12">
<CCard>
<CCardBody>
<CForm>
<CRow class="align-items-stretch">
<CCol sm="12">
<p>دسته بندی</p>
<el-select v-model="project.category" filterable :class="validation.category? 'err' : null">
<el-option v-for="item in projectCategories" :label="item.locale.fa.name" :value="item._id" :key="item._id"/>
</el-select>
<p class="text-danger" v-if="validation.category">{{ validation.category.msg }}</p>
<el-divider></el-divider>
<p>دسته بندی زیر مجموعه</p>
<el-select v-model="project.tag" filterable clearable>
<el-option v-for="item in availableTags" :label="item.locale.fa.name" :value="item._id" :key="item._id"/>
</el-select>
<el-divider></el-divider>
<el-checkbox label="دارای صفحه توضیحات میباشد" v-model="project.has_details"/>
<el-divider></el-divider>
<CInput
:class="validation.project_date ? 'err' : null"
style="width: 300px;"
label="سال اجرای پروژه (سال شمسی)"
placeholder="مثال: 1390"
:description="validation.project_date ? validation.project_date.msg : null"
v-model="project.project_date"
/>
<el-divider></el-divider>
<CInput
:class="validation.fa_size || validation.en_size ? 'err' : null"
label="حجم"
style="width: 300px;"
placeholder="کیلوگرم"
:description="validation.fa_size || validation.en_size ? validation.fa_size.msg || validation.en_size.msg : null"
v-model="project.locale.fa.size"
/>
<CInput
:class="validation.fa_area || validation.en_area ? 'err' : null"
label="متراژ"
style="width: 300px;"
placeholder="متر"
:description="validation.fa_area || validation.en_area ? validation.fa_area.msg || validation.en_area.msg : null"
v-model="project.locale.fa.area"
/>
<el-divider></el-divider>
</CCol>
<CCol sm="6">
<h2>نسخه انگلیسی</h2>
<el-divider></el-divider>
<CInput
:class="validation.en_title ? 'err' : null"
label="عنوان انگلیسی"
:description="validation.en_title ? validation.en_title.msg : null"
v-model="project.locale.en.title"
/>
<CTextarea
:class="validation.en_short_description ? 'err' : null"
label="توضیح کوتاه انگلیسی"
:description="validation.en_short_description ? validation.en_short_description.msg : null"
v-model="project.locale.en.short_description"
/>
<CTextarea
:class="validation.en_description ? 'err' : null"
label="توضیحات انگلیسی"
:description="validation.en_description ? validation.en_description.msg : null"
v-model="project.locale.en.description"
/>
<el-divider></el-divider>
<CInput
:class="validation.en_client ? 'err' : null"
label="نام مشتری"
:description="validation.en_client ? validation.en_client.msg : null"
v-model="project.locale.en.client"
/>
<el-divider></el-divider>
<CInput
:class="validation.en_s3_title ? 'err' : null"
label="عنوان بخش سوم صفحه"
:description="validation.en_s3_title ? validation.en_s3_title.msg : null"
v-model="project.locale.en.s3_title"
/>
<CTextarea
:class="validation.en_s3_description ? 'err' : null"
label="توضیحات بخش سوم صفحه"
:description="validation.en_s3_description ? validation.en_s3_description.msg : null"
v-model="project.locale.en.s3_description"
/>
<el-divider></el-divider>
<CInput
:class="validation.en_s5_title ? 'err' : null"
label="عنوان بخش پنجم صفحه"
:description="validation.en_s5_title ? validation.en_s5_title.msg : null"
v-model="project.locale.en.s5_title"
/>
<CTextarea
:class="validation.en_s5_description ? 'err' : null"
label="توضیحات بخش پنجم صفحه"
:description="validation.en_s5_description ? validation.en_s5_description.msg : null"
v-model="project.locale.en.s5_description"
/>
<el-divider></el-divider>
<CInput
:class="validation.en_s6_title ? 'err' : null"
label="عنوان بخش ششم صفحه"
:description="validation.en_s6_title ? validation.en_s6_title.msg : null"
v-model="project.locale.en.s6_title"
/>
<CTextarea
:class="validation.en_s6_description ? 'err' : null"
label="توضیحات بخش ششم صفحه"
:description="validation.en_s6_description ? validation.en_s6_description.msg : null"
v-model="project.locale.en.s6_description"
/>
</CCol>
<CCol sm="6">
<h2>نسخه فارسی</h2>
<el-divider></el-divider>
<CInput
:class="validation.fa_title ? 'err' : null"
label="عنوان فارسی"
:description="validation.fa_title ? validation.fa_title.msg : null"
v-model="project.locale.fa.title"
/>
<CTextarea
:class="validation.fa_short_description ? 'err' : null"
label="توضیح کوتاه فارسی"
:description="validation.fa_short_description ? validation.fa_short_description.msg : null"
v-model="project.locale.fa.short_description"
/>
<CTextarea
:class="validation.fa_description ? 'err' : null"
label="توضیحات فارسی"
:description="validation.fa_description ? validation.fa_description.msg : null"
v-model="project.locale.fa.description"
/>
<el-divider></el-divider>
<CInput
:class="validation.fa_client ? 'err' : null"
label="نام مشتری"
:description="validation.fa_client ? validation.fa_client.msg : null"
v-model="project.locale.fa.client"
/>
<el-divider></el-divider>
<CInput
:class="validation.fa_s3_title ? 'err' : null"
label="عنوان بخش سوم صفحه"
:description="validation.fa_s3_title ? validation.fa_s3_title.msg : null"
v-model="project.locale.fa.s3_title"
/>
<CTextarea
:class="validation.fa_s3_description ? 'err' : null"
label="توضیحات بخش سوم صفحه"
:description="validation.fa_s3_description ? validation.fa_s3_description.msg : null"
v-model="project.locale.fa.s3_description"
/>
<el-divider></el-divider>
<CInput
:class="validation.fa_s5_title ? 'err' : null"
label="عنوان بخش پنجم صفحه"
:description="validation.fa_s5_title ? validation.fa_s5_title.msg : null"
v-model="project.locale.fa.s5_title"
/>
<CTextarea
:class="validation.fa_s5_description ? 'err' : null"
label="توضیحات بخش پنجم صفحه"
:description="validation.fa_s5_description ? validation.fa_s5_description.msg : null"
v-model="project.locale.fa.s5_description"
/>
<el-divider></el-divider>
<CInput
:class="validation.fa_s6_title ? 'err' : null"
label="عنوان بخش ششم صفحه"
:description="validation.fa_s6_title ? validation.fa_s6_title.msg : null"
v-model="project.locale.fa.s6_title"
/>
<CTextarea
:class="validation.fa_s6_description ? 'err' : null"
label="توضیحات بخش ششم صفحه"
:description="validation.fa_s6_description ? validation.fa_s6_description.msg : null"
v-model="project.locale.fa.s6_description"
/>
</CCol>
</CRow>
</CForm>
</CCardBody>
</CCard>
</CCol>
<!-- ### add hero cover ###-->
<CCol lg="6">
<CCard>
<CCardBody>
<h2>کاور صفحه</h2>
<el-divider></el-divider>
<img :src="project.cover" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="cover" @change="preview">
<p class="text-danger" v-if="validation.cover">{{ validation.cover.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<!-- ### add s2_image ###-->
<CCol lg="6">
<CCard>
<CCardBody>
<h2>تصویر بخش دوم صفحه</h2>
<el-divider></el-divider>
<img :src="project.s2_image" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="s2_image" @change="preview2">
<p class="text-danger" v-if="validation.s2_image">{{ validation.s2_image.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<!-- ### add s4_image ###-->
<CCol lg="6">
<CCard>
<CCardBody>
<h2>تصویر بخش چهارم صفحه</h2>
<el-divider></el-divider>
<img :src="project.s4_image" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="s4_image" @change="preview3">
<p class="text-danger" v-if="validation.s4_image">{{ validation.s4_image.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<!-- ### add s5_image ###-->
<CCol lg="6">
<CCard>
<CCardBody>
<h2>تصویر بخش پنجم صفحه</h2>
<el-divider></el-divider>
<img :src="project.s5_image" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="s5_image" @change="preview4">
<p class="text-danger" v-if="validation.s5_image">{{ validation.s5_image.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<!-- ### add s6_image ###-->
<CCol lg="6">
<CCard>
<CCardBody>
<h2>تصویر بخش ششم صفحه</h2>
<el-divider></el-divider>
<img :src="project.s6_image" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="s6_image" @change="preview5">
<p class="text-danger" v-if="validation.s6_image">{{ validation.s6_image.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<!-- ### project gallery ###-->
<CCol sm="12">
<CCard>
<CCardBody>
<h2>گالری تصاویر پروژه</h2>
<el-divider></el-divider>
<img :src="imageGallery" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="image" @change="preview6">
<p class="text-danger" v-if="validation.image">{{ validation.image.msg }}</p>
<el-button type="success" @click="addImage">افزودن</el-button>
<el-divider></el-divider>
<h2>تصاویر</h2>
<div class="images">
<div class="row">
<div class="col-4 col-md-2 image" v-for="item in project.images" :key="item._id">
<img :src="item.image" alt="">
<i class="far fa-trash-alt" title="حذف" @click="removeImage(item._id)"></i>
</div>
</div>
</div>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
import axiosUploadProcess from "@/mixins/axiosUploadProcess"
export default {
data() {
return {
project: null,
projectCategories: null,
imageGallery: '',
validation: {}
}
},
mixins: [axiosUploadProcess],
computed: {
title() {
return this.$route.params.post === 'new' ? 'افزودن پست' : 'مشاهده پست'
},
availableTags() {
return this.projectCategories.find(item => item._id === this.project.category)?.tags || []
}
},
methods: {
addImage() {
this.validation = {}
const data = new FormData()
data.append('image', this.$refs.image.files[0])
this.$axios.post(`/api/admin/projectImage/${this.project._id}`, data)
.then(response => {
this.$message({
type: 'success',
message: 'تصویر با موفقیت افزوده شد.'
})
this.$refs.image.value = null
this.imageGallery = ''
this.$nuxt.refresh()
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
return this.$message({
type: 'warning',
message: 'پارامتر ها رو بررسی و دوباره تلاش کنید'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
},
removeImage(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/projectImage/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'تصویر با موفقیت حذف شد'
})
this.project.images = this.project.images.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
},
update() {
this.validation = {}
const data = new FormData()
data.append('fa_title', this.project.locale.fa.title || '')
data.append('en_title', this.project.locale.en.title || '')
data.append('fa_short_description', this.project.locale.fa.short_description || '')
data.append('en_short_description', this.project.locale.en.short_description || '')
data.append('fa_description', this.project.locale.fa.description || '')
data.append('en_description', this.project.locale.en.description || '')
data.append('fa_client', this.project.locale.fa.client || '')
data.append('en_client', this.project.locale.en.client || '')
data.append('fa_size', this.project.locale.fa.size || '')
data.append('en_size', this.project.locale.fa.size || '')
data.append('fa_area', this.project.locale.fa.area || '')
data.append('en_area', this.project.locale.fa.area || '')
data.append('fa_s3_title', this.project.locale.fa.s3_title || '')
data.append('en_s3_title', this.project.locale.en.s3_title || '')
data.append('fa_s3_description', this.project.locale.fa.s3_description || '')
data.append('en_s3_description', this.project.locale.en.s3_description || '')
data.append('fa_s5_title', this.project.locale.fa.s5_title || '')
data.append('en_s5_title', this.project.locale.en.s5_title || '')
data.append('fa_s5_description', this.project.locale.fa.s5_description || '')
data.append('en_s5_description', this.project.locale.en.s5_description || '')
data.append('fa_s6_title', this.project.locale.fa.s6_title || '')
data.append('en_s6_title', this.project.locale.en.s6_title || '')
data.append('fa_s6_description', this.project.locale.fa.s6_description || '')
data.append('en_s6_description', this.project.locale.en.s6_description || '')
data.append('category', this.project.category || '')
data.append('tag', this.project.tag || '')
data.append('has_details', this.project.has_details)
data.append('project_date', this.project.project_date)
if (this.$refs.cover.files[0]) data.append('cover', this.$refs.cover.files[0])
if (this.$refs.s2_image.files[0]) data.append('s2_image', this.$refs.s2_image.files[0])
if (this.$refs.s4_image.files[0]) data.append('s4_image', this.$refs.s4_image.files[0])
if (this.$refs.s5_image.files[0]) data.append('s5_image', this.$refs.s5_image.files[0])
if (this.$refs.s6_image.files[0]) data.append('s6_image', this.$refs.s6_image.files[0])
this.$axios.put(`/api/admin/project/${this.project._id}`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'اطلاعات بروزرسانی شد.'
})
this.$refs.cover.value = null
this.$refs.s2_image.value = null
this.$refs.s4_image.value = null
this.$refs.s5_image.value = null
this.$refs.s6_image.value = null
this.$nuxt.refresh()
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
return this.$message({
type: 'warning',
message: 'پارامتر ها رو بررسی و دوباره تلاش کنید'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
},
preview() {
this.project.cover = URL.createObjectURL(event.target.files[0])
},
preview2() {
this.project.s2_image = URL.createObjectURL(event.target.files[0])
},
preview3() {
this.project.s4_image = URL.createObjectURL(event.target.files[0])
},
preview4() {
this.project.s5_image = URL.createObjectURL(event.target.files[0])
},
preview5() {
this.project.s6_image = URL.createObjectURL(event.target.files[0])
},
preview6() {
this.imageGallery = URL.createObjectURL(event.target.files[0])
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
const projectCategories = await $axios.get(`/api/public/projectCategories`)
const project = await $axios.get(`/api/public/project/${params.project}`)
return {
projectCategories: projectCategories.data,
project: project.data
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
<style lang="scss" scoped>
.images {
.image {
position: relative;
box-sizing: border-box;
text-align: center;
img {
width: 95%;
height: 100%;
object-fit: cover;
}
i {
padding: 15px;
background-color: rgba(red, 0.5);
color: #fff;
border-radius: 5px;
font-size: 25px;
cursor: pointer;
transition: 0.3s;
position: absolute;
bottom: 10px;
right: 20px;
&:hover {
background-color: red;
}
}
}
}
</style>
+157
View File
@@ -0,0 +1,157 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="success" :to="{name: 'admin-projects-new'}" class="mr-auto">افزودن</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<el-table
:data="projects"
style="width: 100%">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
label="تصویر"
width="150">
<template slot-scope="scope">
<img :src="scope.row.thumb" alt="" style="width: 100%;">
</template>
</el-table-column>
<el-table-column
prop="locale.fa.title"
label="عنوان فارسی"
width="">
</el-table-column>
<el-table-column
prop="locale.en.title"
label="عنوان انگلیسی"
width="">
</el-table-column>
<el-table-column
prop="locale.en.client"
label="نام انگلیسی کارفرما"
width="">
</el-table-column>
<el-table-column
prop="locale.fa.client"
label="نام فارسی کارفرما"
width="">
</el-table-column>
<el-table-column
label="دسته بندی"
width="">
<template slot-scope="scope">
<span>{{ scope.row.category.locale.fa.name }}</span>
<span v-if="scope.row.tag"> ({{ getTagName(scope.row.category._id, scope.row.tag) }}) </span>
<span></span>
</template>
</el-table-column>
<el-table-column
label="ویرایش"
width="110"
align="center">
<template slot-scope="scope">
<CButton color="danger" variant="outline" :key="scope.row._id + Math.random()" @click="remove(scope.row._id)">
<i class="far fa-trash-alt"></i>
</CButton>
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-projects-project',params: {project: scope.row._id}}">
<i class="far fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست پروژه ها',
list_title: 'لیست',
projects: null,
projectCategories: null
}
},
methods: {
getTagName(categoryId, tagId) {
const category = this.projectCategories.find(item => item._id === categoryId)
return category?.tags?.find(item => item._id === tagId)?.locale.fa.name || ''
},
remove(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/project/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'پروژه با موفقیت حذف شد'
})
this.projects = this.projects.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const projects = await $axios.get(`/api/public/projects`)
const projectCategories = await $axios.get(`/api/public/projectCategories`)
return {
projects: projects.data,
projectCategories: projectCategories.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>
+151
View File
@@ -0,0 +1,151 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-projects'}">برگشت به صفحه قبل</CButton>
<CButton size="sm" color="success" class="mr-1" @click="post">افزودن</CButton>
</CustomSubHeader>
<CRow>
<CCol lg="6">
<CCard>
<CCardBody>
<CForm>
<CRow>
<CCol sm="12">
<p>دسته بندی</p>
<el-select v-model="project.category" filterable :class="validation.category? 'err' : null">
<el-option v-for="item in projectCategories" :label="item.locale.fa.name" :value="item._id" :key="item._id"/>
</el-select>
<p class="text-danger" v-if="validation.category">{{ validation.category.msg }}</p>
<el-divider></el-divider>
<p>دسته بندی زیر مجموعه</p>
<el-select v-model="project.tag" filterable clearable>
<el-option v-for="item in availableTags" :label="item.locale.fa.name" :value="item._id" :key="item._id"/>
</el-select>
<el-divider></el-divider>
<CInput
:class="validation.project_date ? 'err' : null"
label="سال اجرای پروژه (سال شمسی)"
placeholder="مثال: 1390"
:description="validation.project_date ? validation.project_date.msg : null"
v-model="project.project_date"
/>
<el-divider></el-divider>
<CInput
:class="validation.fa_title ? 'err' : null"
label="عنوان فارسی"
:description="validation.fa_title ? validation.fa_title.msg : null"
v-model="project.fa_title"
/>
<CInput
:class="validation.fa_client ? 'err' : null"
label="نام مشتری فارسی"
:description="validation.fa_client ? validation.fa_client.msg : null"
v-model="project.fa_client"
/>
<el-divider></el-divider>
<CInput
:class="validation.en_title ? 'err' : null"
label="عنوان انگلیسی"
:description="validation.en_title ? validation.en_title.msg : null"
v-model="project.en_title"
/>
<CInput
:class="validation.en_client ? 'err' : null"
label="نام مشتری انگلیسی"
:description="validation.en_client ? validation.en_client.msg : null"
v-model="project.en_client"
/>
<el-divider></el-divider>
<el-checkbox label="دارای صفحه توضیحات میباشد" v-model="project.has_details"/>
</CCol>
</CRow>
</CForm>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
export default {
data() {
return {
title: 'افزودن پروژه جدید',
projectCategories: null,
project: {
fa_title: '',
en_title: '',
fa_client: '',
en_client: '',
has_details: false,
category: '',
tag: ''
},
validation: {}
}
},
computed: {
availableTags() {
return this.projectCategories.find(item => item._id === this.project.category)?.tags || []
}
},
methods: {
post() {
this.validation = {}
this.$axios.post(`/api/admin/project`, this.project)
.then(response => {
this.$message({
type: 'success',
message: 'محصول با موفقیت ایجاد شد.'
})
if (this.project.has_details) this.$router.push({name: 'admin-projects-project', params: {project: response.data._id}})
else this.$router.push({name: 'admin-projects'})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
return this.$message({
type: 'warning',
message: 'پارامتر ها رو بررسی و دوباره تلاش کنید'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
},
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
const projectCategories = await $axios.get(`/api/public/projectCategories`)
return {
projectCategories: projectCategories.data
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+265
View File
@@ -0,0 +1,265 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin'}">برگشت به صفحه قبل</CButton>
<!-- <CButton v-else size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>-->
</CustomSubHeader>
<CRow>
<CCol lg="6">
<CCard>
<CCardHeader><h4>کاور صفحه درباره ما</h4></CCardHeader>
<CCardBody>
<!-- <h2>کاور صفحه درباره ما</h2>-->
<!-- <el-divider></el-divider>-->
<el-upload :show-file-list="false" :action="`/api/admin/setting/aboutUS`" class="avatar-uploader"
name="file"
:headers="{'Authorization' : `Bearer ${$auth.user.token}`}"
:on-success="fileUploadSuccess"
:on-progress="handleProcess" :on-error="fileUploadError">
<img v-if="setting.aboutUS && !setting.aboutUS.includes('undefined')" :src="setting.aboutUS" class="avatar" alt="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p class="mt-3 text-muted text-center">
عکس 600*1920 باشد. در غیر این صورت اتوماتیک بریده می شود.
</p>
<p class="text-danger text-center" v-if="validation.aboutUS">{{ validation.aboutUS.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardHeader><h4>کاور صفحه فعالیت ها</h4></CCardHeader>
<CCardBody>
<!-- <h2>کاور صفحه فعالیت ها</h2>-->
<!-- <el-divider></el-divider>-->
<el-upload :show-file-list="false" :action="`/api/admin/setting/activity`" class="avatar-uploader"
name="file"
:headers="{'Authorization' : `Bearer ${$auth.user.token}`}"
:on-success="fileUploadSuccess"
:on-progress="handleProcess" :on-error="fileUploadError">
<img v-if="setting.activity && !setting.activity.includes('undefined')" :src="setting.activity" class="avatar" alt="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p class="mt-3 text-muted text-center">
عکس 600*1920 باشد. در غیر این صورت اتوماتیک بریده می شود.
</p>
<p class="text-danger text-center" v-if="validation.activity">{{ validation.activity.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardHeader><h4>کاور صفحه پروژه ها</h4></CCardHeader>
<CCardBody>
<!-- <h2>کاور صفحه پروژه ها</h2>-->
<!-- <el-divider></el-divider>-->
<el-upload :show-file-list="false" :action="`/api/admin/setting/projects`" class="avatar-uploader"
name="file"
:headers="{'Authorization' : `Bearer ${$auth.user.token}`}"
:on-success="fileUploadSuccess"
:on-progress="handleProcess" :on-error="fileUploadError">
<img v-if="setting.projects && !setting.projects.includes('undefined')" :src="setting.projects" class="avatar" alt="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p class="mt-3 text-muted text-center">
عکس 600*1920 باشد. در غیر این صورت اتوماتیک بریده می شود.
</p>
<p class="text-danger text-center" v-if="validation.projects">{{ validation.projects.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardHeader><h4>کاور صفحه گالری</h4></CCardHeader>
<CCardBody>
<!-- <h2>کاور صفحه گالری</h2>-->
<!-- <el-divider></el-divider>-->
<el-upload :show-file-list="false" :action="`/api/admin/setting/gallery`" class="avatar-uploader"
name="file"
:headers="{'Authorization' : `Bearer ${$auth.user.token}`}"
:on-success="fileUploadSuccess"
:on-progress="handleProcess" :on-error="fileUploadError">
<img v-if="setting.gallery && !setting.gallery.includes('undefined')" :src="setting.gallery" class="avatar" alt="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p class="mt-3 text-muted text-center">
عکس 600*1920 باشد. در غیر این صورت اتوماتیک بریده می شود.
</p>
<p class="text-danger text-center" v-if="validation.gallery">{{ validation.gallery.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardHeader><h4>کاور صفحه کاتالوگ</h4></CCardHeader>
<CCardBody>
<!-- <h2>کاور صفحه کاتالوگ</h2>-->
<!-- <el-divider></el-divider>-->
<el-upload :show-file-list="false" :action="`/api/admin/setting/catalog`" class="avatar-uploader"
name="file"
:headers="{'Authorization' : `Bearer ${$auth.user.token}`}"
:on-success="fileUploadSuccess"
:on-progress="handleProcess" :on-error="fileUploadError">
<img v-if="setting.catalog && !setting.catalog.includes('undefined')" :src="setting.catalog" class="avatar" alt="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p class="mt-3 text-muted text-center">
عکس 600*1920 باشد. در غیر این صورت اتوماتیک بریده می شود.
</p>
<p class="text-danger text-center" v-if="validation.catalog">{{ validation.catalog.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardHeader><h4>کاور صفحه رویداد</h4></CCardHeader>
<CCardBody>
<!-- <h2>کاور صفحه رویداد</h2>-->
<!-- <el-divider></el-divider>-->
<el-upload :show-file-list="false" :action="`/api/admin/setting/blogs`" class="avatar-uploader"
name="file"
:headers="{'Authorization' : `Bearer ${$auth.user.token}`}"
:on-success="fileUploadSuccess"
:on-progress="handleProcess" :on-error="fileUploadError">
<img v-if="setting.blogs && !setting.blogs.includes('undefined')" :src="setting.blogs" class="avatar" alt="">
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
<p class="mt-3 text-muted text-center">
عکس 600*1920 باشد. در غیر این صورت اتوماتیک بریده می شود.
</p>
<p class="text-danger text-center" v-if="validation.blogs">{{ validation.blogs.msg }}</p>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
export default {
data() {
return {
setting: null,
loading: false,
validation: {}
}
},
computed: {
title() {
return this.$route.params.team === 'new' ? 'افزودن عضو جدید' : 'مشاهده اطلاعات شخص'
}
},
methods: {
preview() {
this.team.image = URL.createObjectURL(event.target.files[0])
},
post() {
this.validation = {}
const data = new FormData()
data.append('index', this.team.index)
data.append('fa_first_name', this.team.locale.fa.first_name)
data.append('en_first_name', this.team.locale.en.first_name)
data.append('fa_last_name', this.team.locale.fa.last_name)
data.append('en_last_name', this.team.locale.en.last_name)
data.append('fa_position', this.team.locale.fa.position)
data.append('en_position', this.team.locale.en.position)
data.append('image', this.$refs.image.files[0])
this.$axios.post(`/api/admin/team`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'عضو با موفقیت ایجاد شد.'
})
this.$router.push({name: 'admin-team'})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
return this.$message({
type: 'warning',
message: 'پارامتر ها رو بررسی و دوباره تلاش کنید'
})
} else console.log(err.response.data)
})
},
update() {
this.validation = {}
const data = new FormData()
data.append('index', this.team.index)
data.append('fa_first_name', this.team.locale.fa.first_name)
data.append('en_first_name', this.team.locale.en.first_name)
data.append('fa_last_name', this.team.locale.fa.last_name)
data.append('en_last_name', this.team.locale.en.last_name)
data.append('fa_position', this.team.locale.fa.position)
data.append('en_position', this.team.locale.en.position)
if (this.$refs.image.files[0]) data.append('image', this.$refs.image.files[0])
this.$axios.put(`/api/admin/team/${this.team._id}`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'اطلاعات بروزرسانی شد.'
})
this.$refs.image.value = null
this.$nuxt.refresh()
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
},
fileUploadSuccess(res, file, fileList) {
this.loading = false;
this.$nuxt.refresh();
},
handleProcess(err, file, fileList) {
this.loading = true;
},
fileUploadError(err, file, fileList) {
this.validation = JSON.parse(err.message).validation;
},
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
const setting = await $axios.$get(`/api/admin/setting`)
return {
setting
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+213
View File
@@ -0,0 +1,213 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-slider'}">برگشت به صفحه قبل</CButton>
<CButton v-if="$route.params.slide === 'new'" size="sm" color="success" class="mr-1" @click="post">افزودن</CButton>
<!-- <CButton v-else size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>-->
</CustomSubHeader>
<CRow>
<!-- <CCol lg="6">-->
<!-- <CCard>-->
<!-- <CCardBody>-->
<!-- <CForm>-->
<!-- <h4 class="mt-5">فارسی</h4>-->
<!-- <el-divider></el-divider>-->
<!-- <CInput-->
<!-- :class="validation.fa_name ? 'err' : null"-->
<!-- label="نام فارسی"-->
<!-- :description="validation.fa_name ? validation.fa_name.msg : null"-->
<!-- v-model="slide.locale.fa.name"-->
<!-- />-->
<!-- <CInput-->
<!-- :class="validation.fa_position ? 'err' : null"-->
<!-- label="سمت فارسی"-->
<!-- :description="validation.fa_position ? validation.fa_position.msg : null"-->
<!-- v-model="slide.locale.fa.position"-->
<!-- />-->
<!-- <CTextarea-->
<!-- :class="validation.fa_slide ? 'err' : null"-->
<!-- label="کامنت فارسی"-->
<!-- :description="validation.fa_slide ? validation.fa_slide.msg : null"-->
<!-- v-model="slide.locale.fa.slide"-->
<!-- />-->
<!-- <h4 class="mt-5">انگلیسی</h4>-->
<!-- <el-divider></el-divider>-->
<!-- <CInput-->
<!-- :class="validation.en_name ? 'err' : null"-->
<!-- label="نام انگلیسی"-->
<!-- :description="validation.en_name ? validation.en_name.msg : null"-->
<!-- v-model="slide.locale.en.name"-->
<!-- />-->
<!-- <CInput-->
<!-- :class="validation.en_position ? 'err' : null"-->
<!-- label="سمت انگلیسی"-->
<!-- :description="validation.en_position ? validation.en_position.msg : null"-->
<!-- v-model="slide.locale.en.position"-->
<!-- />-->
<!-- <CTextarea-->
<!-- :class="validation.en_slide ? 'err' : null"-->
<!-- label="کامنت انگلیسی"-->
<!-- :description="validation.en_slide ? validation.en_slide.msg : null"-->
<!-- v-model="slide.locale.en.slide"-->
<!-- />-->
<!-- </CForm>-->
<!-- </CCardBody>-->
<!-- </CCard>-->
<!-- </CCol>-->
<CCol sm="12">
<CCard>
<CCardBody>
<el-switch style="direction: ltr" v-model="slide.isImage" active-text="عکس" inactive-text="ویدیو" inactive-color="#ff4949"></el-switch>
</CCardBody>
</CCard>
</CCol>
<CCol v-if="slide.isImage" lg="6">
<CCard>
<CCardBody>
<h2>عکس</h2>
<el-divider></el-divider>
<img :src="slide.image" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="image" @change="preview">
<p class="text-danger" v-if="validation.image">{{ validation.image.msg }}</p>
</CCardBody>
</CCard>
</CCol>
<CCol v-else lg="6">
<CCard>
<CCardBody>
<h2>ویدیو</h2>
<el-divider></el-divider>
<video :src="slide.video" style="width: 100%;max-width: 600px;" controls muted autoplay></video>
<input type="file" ref="video" @change="preview2">
<p class="text-danger" v-if="validation.video">{{ validation.video.msg }}</p>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
import axiosUploadProcess from "~/mixins/axiosUploadProcess"
export default {
data() {
return {
slide: null,
validation: {}
}
},
mixins: [axiosUploadProcess],
computed: {
title() {
return this.$route.params.slide === 'new' ? 'افزودن اسلاید جدید' : 'مشاهده اطلاعات اسلاید'
}
},
methods: {
preview() {
this.slide.image = URL.createObjectURL(event.target.files[0])
},
preview2() {
this.slide.video = URL.createObjectURL(event.target.files[0])
},
post() {
this.validation = {}
const data = new FormData()
data.append('isImage', this.slide.isImage)
if (this.slide.isImage) data.append('image', this.$refs.image.files[0])
else data.append('video', this.$refs.video.files[0])
this.$axios.post(`/api/admin/slide`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'اسلاید با موفقیت ایجاد شد.'
})
this.$router.push({name: 'admin-slider'})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
return this.$message({
type: 'warning',
message: 'پارامتر ها رو بررسی و دوباره تلاش کنید'
})
} else console.log(err.response.data)
})
},
// update() {
// this.validation = {}
// const data = new FormData()
// data.append('fa_name', this.slide.locale.fa.name)
// data.append('en_name', this.slide.locale.en.name)
//
// data.append('fa_position', this.slide.locale.fa.position)
// data.append('en_position', this.slide.locale.en.position)
//
// data.append('fa_slide', this.slide.locale.fa.slide)
// data.append('en_slide', this.slide.locale.en.slide)
//
// if (this.$refs.image.files[0]) data.append('image', this.$refs.image.files[0])
//
// this.$axios.put(`/api/admin/slide/${this.slide._id}`, data, this.axiosConfig)
// .then(response => {
// this.$message({
// type: 'success',
// message: 'اطلاعات بروزرسانی شد.'
// })
// this.$refs.image.value = null
// this.$nuxt.refresh()
// })
// .catch(err => {
// if (err.response.status === 401) {
// return this.$message({
// type: 'error',
// message: 'لطفا دوباره وارد سیستم شوید.'
// })
// }
// if (err.response.status === 422) this.validation = err.response.data.validation
// else console.log(err.response.data)
// })
// }
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
if (params.slide !== 'new') {
const slide = await $axios.get(`/api/public/slide/${params.slide}`)
return {
slide: slide.data
}
} else {
return {
slide: {
isImage: true,
image: '',
video: ''
}
}
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+126
View File
@@ -0,0 +1,126 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="success" :to="{name: 'admin-slider-slide',params:{slide: 'new'}}" class="mr-auto">افزودن</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<el-table
:data="slides"
style="width: 100%">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
label="مدیا"
width="250">
<template slot-scope="scope">
<img v-if="scope.row.isImage" :src="scope.row.image" alt="" style="width: 100%;">
<video v-else :src="scope.row.video" style="width: 100%;" controls muted></video>
</template>
</el-table-column>
<el-table-column
label="نوع"
width="">
<template slot-scope="scope">
<span v-if="scope.row.isImage">عکس</span>
<span v-else>ویدیو</span>
</template>
</el-table-column>
<el-table-column
label="ویرایش"
width="110"
align="center">
<template slot-scope="scope">
<CButton color="danger" variant="outline" :key="scope.row._id + Math.random()" @click="remove(scope.row._id)">
<i class="far fa-trash-alt"></i>
</CButton>
<!-- <CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-slider-slide',params: {slide: scope.row._id}}">-->
<!-- <i class="far fa-eye"></i>-->
<!-- </CButton>-->
</template>
</el-table-column>
</el-table>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست اسلاید های صفحه اصلی',
list_title: 'لیست',
slides: null
}
},
methods: {
remove(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/slide/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'مورد با موفقیت حذف شد'
})
this.slides = this.slides.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const slides = await $axios.get(`/api/public/slides`)
return {
slides: slides.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>
+223
View File
@@ -0,0 +1,223 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="primary" class="mr-auto" :to="{name: 'admin-team'}">برگشت به صفحه قبل</CButton>
<CButton v-if="$route.params.team === 'new'" size="sm" color="success" class="mr-1" @click="post">افزودن</CButton>
<CButton v-else size="sm" color="success" class="mr-1" @click="update">بروزرسانی</CButton>
</CustomSubHeader>
<CRow>
<CCol lg="6">
<CCard>
<CCardBody>
<CForm>
<h4>شماره ترتیب نمایش</h4>
<el-divider></el-divider>
<el-select v-model="team.index" filterable>
<el-option v-for="index in 10000" :key="index" :label="index" :value="index" v-if="checkIndexes(index)"/>
</el-select>
<p class="text-danger" v-if="validation.index">{{ validation.index.msg }}</p>
<h4 class="mt-5">فارسی</h4>
<el-divider></el-divider>
<CInput
:class="validation.fa_first_name ? 'err' : null"
label="نام فارسی"
:description="validation.fa_first_name ? validation.fa_first_name.msg : null"
v-model="team.locale.fa.first_name"
/>
<CInput
:class="validation.fa_last_name ? 'err' : null"
label="نام خانوادگی فارسی"
:description="validation.fa_last_name ? validation.fa_last_name.msg : null"
v-model="team.locale.fa.last_name"
/>
<CInput
:class="validation.fa_position ? 'err' : null"
label="سمت فارسی"
:description="validation.fa_position ? validation.fa_position.msg : null"
v-model="team.locale.fa.position"
/>
<h4 class="mt-5">انگلیسی</h4>
<el-divider></el-divider>
<CInput
:class="validation.en_first_name ? 'err' : null"
label="نام انگلیسی"
:description="validation.en_first_name ? validation.en_first_name.msg : null"
v-model="team.locale.en.first_name"
/>
<CInput
:class="validation.en_last_name ? 'err' : null"
label="نام خانوادگی انگلیسی"
:description="validation.en_last_name ? validation.en_last_name.msg : null"
v-model="team.locale.en.last_name"
/>
<CInput
:class="validation.en_position ? 'err' : null"
label="سمت انگلیسی"
:description="validation.en_position ? validation.en_position.msg : null"
v-model="team.locale.en.position"
/>
</CForm>
</CCardBody>
</CCard>
</CCol>
<CCol lg="6">
<CCard>
<CCardBody>
<h2>تصویر</h2>
<el-divider></el-divider>
<img :src="team.image" alt="" style="width: 100%;max-width: 600px;">
<input type="file" ref="image" @change="preview">
<p class="text-danger" v-if="validation.image">{{ validation.image.msg }}</p>
</CCardBody>
</CCard>
</CCol>
</CRow>
</div>
</template>
<script>
export default {
data() {
return {
teams: null,
team: null,
validation: {}
}
},
computed: {
title() {
return this.$route.params.team === 'new' ? 'افزودن عضو جدید' : 'مشاهده اطلاعات شخص'
}
},
methods: {
preview() {
this.team.image = URL.createObjectURL(event.target.files[0])
},
post() {
this.validation = {}
const data = new FormData()
data.append('index', this.team.index)
data.append('fa_first_name', this.team.locale.fa.first_name)
data.append('en_first_name', this.team.locale.en.first_name)
data.append('fa_last_name', this.team.locale.fa.last_name)
data.append('en_last_name', this.team.locale.en.last_name)
data.append('fa_position', this.team.locale.fa.position)
data.append('en_position', this.team.locale.en.position)
data.append('image', this.$refs.image.files[0])
this.$axios.post(`/api/admin/team`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'عضو با موفقیت ایجاد شد.'
})
this.$router.push({name: 'admin-team'})
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) {
this.validation = err.response.data.validation
return this.$message({
type: 'warning',
message: 'پارامتر ها رو بررسی و دوباره تلاش کنید'
})
} else console.log(err.response.data)
})
},
update() {
this.validation = {}
const data = new FormData()
data.append('index', this.team.index)
data.append('fa_first_name', this.team.locale.fa.first_name)
data.append('en_first_name', this.team.locale.en.first_name)
data.append('fa_last_name', this.team.locale.fa.last_name)
data.append('en_last_name', this.team.locale.en.last_name)
data.append('fa_position', this.team.locale.fa.position)
data.append('en_position', this.team.locale.en.position)
if (this.$refs.image.files[0]) data.append('image', this.$refs.image.files[0])
this.$axios.put(`/api/admin/team/${this.team._id}`, data, this.axiosConfig)
.then(response => {
this.$message({
type: 'success',
message: 'اطلاعات بروزرسانی شد.'
})
this.$refs.image.value = null
this.$nuxt.refresh()
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 422) this.validation = err.response.data.validation
else console.log(err.response.data)
})
},
checkIndexes(index) {
return Boolean(!this.teams.filter(item => item.index === index).length)
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, params, error}) {
try {
const teams = await $axios.get(`/api/public/teams`)
if (params.team !== 'new') {
const team = await $axios.get(`/api/public/team/${params.team}`)
return {
teams: teams.data,
team: team.data
}
} else {
return {
teams: teams.data,
team: {
locale: {
fa: {
first_name: '',
last_name: '',
position: ''
},
en: {
first_name: '',
last_name: '',
position: ''
}
},
image: '',
index: ''
}
}
}
} catch (e) {
error({status: 404, message: 'page not found'})
}
}
}
</script>
+130
View File
@@ -0,0 +1,130 @@
<template>
<div>
<CustomSubHeader>
<CBreadcrumb class="border-0 mb-0">{{ title }}</CBreadcrumb>
<CButton size="sm" color="success" :to="{name: 'admin-team-team',params:{team: 'new'}}" class="mr-auto">افزودن</CButton>
</CustomSubHeader>
<CCard>
<CCardHeader>
<slot name="header">
<i class="fal fa-bars"></i>
<span>{{ list_title }}</span>
</slot>
</CCardHeader>
<CCardBody>
<el-table
:data="team"
style="width: 100%">
<el-table-column
type="index"
label="#">
</el-table-column>
<el-table-column
label="عکس"
width="200">
<template slot-scope="scope">
<img :src="scope.row.image" alt="" style="width: 100%;">
</template>
</el-table-column>
<el-table-column
label="نام و نام خانوادگی"
width="">
<template slot-scope="scope">
<span>{{ scope.row.locale.fa.first_name + ' ' + scope.row.locale.fa.last_name }}</span>
</template>
</el-table-column>
<el-table-column
prop="locale.fa.position"
label="سمت"
width="">
</el-table-column>
<el-table-column
label="ویرایش"
width="110"
align="center">
<template slot-scope="scope">
<CButton color="danger" variant="outline" :key="scope.row._id + Math.random()" @click="remove(scope.row._id)">
<i class="far fa-trash-alt"></i>
</CButton>
<CButton color="success" variant="outline" :key="scope.row._id" :to="{name: 'admin-team-team',params: {team: scope.row._id}}">
<i class="far fa-eye"></i>
</CButton>
</template>
</el-table-column>
</el-table>
</CCardBody>
</CCard>
</div>
</template>
<script>
export default {
data() {
return {
title: 'لیست اعضای تیم',
list_title: 'لیست',
team: null
}
},
methods: {
remove(id) {
this.$confirm('این مورد حذف شود؟', 'هشدار', {
confirmButtonText: 'بله',
cancelButtonText: 'لغو',
type: 'warning'
}).then(async () => {
this.$axios.delete(`/api/admin/team/${id}`)
.then(res => {
this.$message({
type: 'success',
message: 'مورد با موفقیت حذف شد'
})
this.team = this.team.filter(item => item._id !== id)
})
.catch(err => {
if (err.response.status === 401) {
return this.$message({
type: 'error',
message: 'لطفا دوباره وارد سیستم شوید.'
})
}
if (err.response.status === 403) {
return this.$message({
type: 'error',
message: err.response.data.message
})
} else console.log(err.response.data)
})
}).catch(() => {
this.$message({
type: 'warning',
message: 'عملیات لغو شد'
})
})
}
},
head() {
return {
title: this.title
}
},
layout: 'admin',
async asyncData({$axios, error}) {
try {
const team = await $axios.get(`/api/public/teams`)
return {
team: team.data
}
} catch (e) {
error({status: 500, message: 'there is a problem here'})
}
}
}
</script>