chore: add shafafiat page
This commit is contained in:
@@ -29,54 +29,24 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="cards">
|
||||
<div class="item">
|
||||
<img src="/static/images/1.svg" alt="" />
|
||||
|
||||
|
||||
|
||||
<div
|
||||
v-for="(item, i) in items"
|
||||
:key="i"
|
||||
class="item">
|
||||
<img :src="`/uploads/images/category/shafafiat/${item.icon}`" alt="شفافیت" />
|
||||
<div class="parent">
|
||||
<div class="right"></div>
|
||||
<div class="left"></div>
|
||||
</div>
|
||||
<p>اسناد مالی</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/static/images/1.svg" alt="" />
|
||||
<div class="parent">
|
||||
<div class="right"></div>
|
||||
<div class="left"></div>
|
||||
</div>
|
||||
<p>اسناد مالی</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/static/images/1.svg" alt="" />
|
||||
<div class="parent">
|
||||
<div class="right"></div>
|
||||
<div class="left"></div>
|
||||
</div>
|
||||
<p>اسناد مالی</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/static/images/1.svg" alt="" />
|
||||
<div class="parent">
|
||||
<div class="right"></div>
|
||||
<div class="left"></div>
|
||||
</div>
|
||||
<p>اسناد مالی</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/static/images/1.svg" alt="" />
|
||||
<div class="parent">
|
||||
<div class="right"></div>
|
||||
<div class="left"></div>
|
||||
</div>
|
||||
<p>اسناد مالی</p>
|
||||
</div>
|
||||
<div class="item">
|
||||
<img src="/static/images/1.svg" alt="" />
|
||||
<div class="parent">
|
||||
<div class="right"></div>
|
||||
<div class="left"></div>
|
||||
</div>
|
||||
<p>اسناد مالی</p>
|
||||
<nuxt-link :to="`/ostandari/category/${item.title}?type=news&id=${item._id}`">
|
||||
<p>{{ item?.title }}</p>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="space"></div>
|
||||
<!-- <div class="col-12 col-md-6 services-view">
|
||||
@@ -110,11 +80,35 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data(){
|
||||
return{
|
||||
items: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
currentPortal() {
|
||||
return this.$route.params.portal;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
async getData() {
|
||||
const req = await this.$axios.get('/api/public/shafafiat')
|
||||
console.log(req.data.data, 'reqq');
|
||||
this.items = req?.data?.data
|
||||
},
|
||||
turnCateString(str) {
|
||||
if (str.length > 22) {
|
||||
return str.substring(0,22) + '...'
|
||||
}else{
|
||||
return str
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -198,8 +192,8 @@ export default {
|
||||
height: 50px;
|
||||
}
|
||||
.item img {
|
||||
height: 80px;
|
||||
width: 80px;
|
||||
height: 65px;
|
||||
width: 65px;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
.item .parent {
|
||||
@@ -231,6 +225,7 @@ export default {
|
||||
}
|
||||
.item p {
|
||||
color: rgb(117, 117, 117);
|
||||
font-size: 14px;
|
||||
}
|
||||
.item:hover {
|
||||
background-color: rgb(247, 247, 247); /* تغییر رنگ پسزمینه به قرمز */
|
||||
|
||||
@@ -196,6 +196,13 @@
|
||||
</CCol>
|
||||
</CRow>
|
||||
</CCol>
|
||||
<CCol lg="6">
|
||||
<h4>افزودن آیکون شفافیت:</h4>
|
||||
<el-divider></el-divider>
|
||||
<img :src="page.icon" alt="" style="width: 100%;">
|
||||
<input type="file" ref="icon" @change="iconPreview">
|
||||
<el-divider></el-divider>
|
||||
</CCol>
|
||||
<CCol lg="6">
|
||||
<h4>مشخصات مدیر صفحه:</h4>
|
||||
<el-divider></el-divider>
|
||||
@@ -380,6 +387,9 @@ export default {
|
||||
imagePreview(e) {
|
||||
this.page.managerCover = URL.createObjectURL(e.target.files[0])
|
||||
},
|
||||
iconPreview(e) {
|
||||
this.page.icon = URL.createObjectURL(e.target.files[0])
|
||||
},
|
||||
post() {
|
||||
this.validation = {}
|
||||
const data = new FormData()
|
||||
@@ -412,6 +422,7 @@ export default {
|
||||
data.append("managerName", this.page.managerName)
|
||||
data.append("managerDescription", this.page.managerDescription)
|
||||
if (this.$refs.managerCover.files[0]) data.append("managerCover", this.$refs.managerCover.files[0])
|
||||
if (this.$refs.icon.files[0]) data.append("icon", this.$refs.icon.files[0])
|
||||
|
||||
this.$axios.post(`/api/admin/category`, data, this.axiosConfig)
|
||||
.then(response => {
|
||||
@@ -485,6 +496,8 @@ export default {
|
||||
data.append("managerName", this.page.managerName)
|
||||
data.append("managerDescription", this.page.managerDescription)
|
||||
if (this.$refs.managerCover.files[0]) data.append("managerCover", this.$refs.managerCover.files[0])
|
||||
if (this.$refs.icon.files[0]) data.append("icon", this.$refs.icon.files[0])
|
||||
|
||||
|
||||
this.$axios.put(`/api/admin/category/${this.page._id}`, data, this.axiosConfig)
|
||||
.then(response => {
|
||||
@@ -679,6 +692,7 @@ export default {
|
||||
hasManagerInfo: false,
|
||||
managerName: '',
|
||||
managerDescription: '',
|
||||
icon: '',
|
||||
managerCover: ''
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user