| @@ -1,4 +1,4 @@ | |||||
| <!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" id="favicon" href="/favicon.svg"/><link rel="stylesheet" href="/fonts/vazir.css"/><script defer="defer" src="https://bazarce.liara.run/script.js" data-website-id="7baabdd5-3224-41c1-9267-d2a1abd29d01"></script><title>NovinPlast</title><script defer="defer" src="/js/chunk-vendors.e14be79b.js"></script><script defer="defer" src="/js/app.9547de3b.js"></script><link href="/css/chunk-vendors.fd1119e3.css" rel="stylesheet"><link href="/css/app.cbef7f68.css" rel="stylesheet"></head><body lang><noscript><strong>We're sorry but NovinPlast doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script>document.addEventListener("DOMContentLoaded", function () { | |||||
| <!doctype html><html lang=""><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><meta name="viewport" content="width=device-width,initial-scale=1"/><link rel="icon" id="favicon" href="/favicon.svg"/><link rel="stylesheet" href="/fonts/vazir.css"/><script defer="defer" src="https://bazarce.liara.run/script.js" data-website-id="7baabdd5-3224-41c1-9267-d2a1abd29d01"></script><title>NovinPlast</title><script defer="defer" src="/js/chunk-vendors.b16869db.js"></script><script defer="defer" src="/js/app.fa8072f6.js"></script><link href="/css/chunk-vendors.fd1119e3.css" rel="stylesheet"><link href="/css/app.cbef7f68.css" rel="stylesheet"></head><body lang><noscript><strong>We're sorry but NovinPlast doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script>document.addEventListener("DOMContentLoaded", function () { | |||||
| const faviconUrl = localStorage.getItem("logo"); | const faviconUrl = localStorage.getItem("logo"); | ||||
| if (faviconUrl) { | if (faviconUrl) { | ||||
| const faviconLink = document.getElementById("favicon"); | const faviconLink = document.getElementById("favicon"); | ||||
| @@ -32,7 +32,7 @@ | |||||
| @input="clearError('title')" | @input="clearError('title')" | ||||
| type="text" | type="text" | ||||
| class="form-control" | class="form-control" | ||||
| placeholder="عنوان برند" | |||||
| placeholder="عنوان دسته" | |||||
| :class="{ 'is-invalid': errors.title }" | :class="{ 'is-invalid': errors.title }" | ||||
| /> | /> | ||||
| <small v-if="errors.title" class="text-danger"> | <small v-if="errors.title" class="text-danger"> | ||||
| @@ -86,7 +86,7 @@ | |||||
| @input="clearError('description')" | @input="clearError('description')" | ||||
| type="text" | type="text" | ||||
| class="form-control" | class="form-control" | ||||
| placeholder="توضیحات برند" | |||||
| placeholder="توضیحات دسته" | |||||
| :class="{ 'is-invalid': errors.description }" | :class="{ 'is-invalid': errors.description }" | ||||
| ></textarea> | ></textarea> | ||||
| <small v-if="errors.description" class="text-danger"> | <small v-if="errors.description" class="text-danger"> | ||||
| @@ -25,13 +25,13 @@ | |||||
| <!-- Brand Title --> | <!-- Brand Title --> | ||||
| <BCol lg="6"> | <BCol lg="6"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label class="form-label">عنوان برند</label> | |||||
| <label class="form-label">عنوان دسته</label> | |||||
| <input | <input | ||||
| v-model="localTitle" | v-model="localTitle" | ||||
| @input="clearError('localTitle')" | @input="clearError('localTitle')" | ||||
| type="text" | type="text" | ||||
| class="form-control" | class="form-control" | ||||
| placeholder="عنوان برند" | |||||
| placeholder="عنوان دسته" | |||||
| :class="{ 'is-invalid': errors.localTitle }" | :class="{ 'is-invalid': errors.localTitle }" | ||||
| /> | /> | ||||
| <small v-if="errors.localTitle" class="text-danger"> | <small v-if="errors.localTitle" class="text-danger"> | ||||
| @@ -43,7 +43,7 @@ | |||||
| <!-- Brand Image Upload --> | <!-- Brand Image Upload --> | ||||
| <BCol lg="6"> | <BCol lg="6"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label class="form-label">تصویر برند</label> | |||||
| <label class="form-label">تصویر دسته</label> | |||||
| <input | <input | ||||
| type="file" | type="file" | ||||
| @@ -73,13 +73,13 @@ | |||||
| <!-- Brand Description --> | <!-- Brand Description --> | ||||
| <BCol lg="12"> | <BCol lg="12"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label class="form-label">توضیحات برند</label> | |||||
| <label class="form-label">توضیحات دسته</label> | |||||
| <textarea | <textarea | ||||
| v-model="localDesc" | v-model="localDesc" | ||||
| @input="clearError('localDesc')" | @input="clearError('localDesc')" | ||||
| type="text" | type="text" | ||||
| class="form-control" | class="form-control" | ||||
| placeholder="توضیحات برند" | |||||
| placeholder="توضیحات دسته" | |||||
| :class="{ 'is-invalid': errors.localDesc }" | :class="{ 'is-invalid': errors.localDesc }" | ||||
| ></textarea> | ></textarea> | ||||
| <small v-if="errors.localDesc" class="text-danger"> | <small v-if="errors.localDesc" class="text-danger"> | ||||
| @@ -203,7 +203,7 @@ export default { | |||||
| const handleSearch = async (searchTerm) => { | const handleSearch = async (searchTerm) => { | ||||
| if (searchTerm.length < 3) return; | if (searchTerm.length < 3) return; | ||||
| categorySelectorLoader.value = true; | categorySelectorLoader.value = true; | ||||
| try { | try { | ||||
| @@ -271,29 +271,29 @@ export default { | |||||
| blogCat.value = blog.value.blog_category_id; | blogCat.value = blog.value.blog_category_id; | ||||
| author.value = blog.value.author; | author.value = blog.value.author; | ||||
| if (editor.value) { | if (editor.value) { | ||||
| quillInstance.value = new Quill(editor.value, { | |||||
| theme: "snow", | |||||
| modules: { | |||||
| toolbar: [ | |||||
| [{ header: "1" }, { header: "2" }, { font: [] }], | |||||
| [{ list: "ordered" }, { list: "bullet" }], | |||||
| [{ align: [] }], | |||||
| ["bold", "italic", "underline"], | |||||
| ["link", "image"], | |||||
| [{ script: "sub" }, { script: "super" }], | |||||
| [{ direction: "rtl" }], | |||||
| ], | |||||
| }, | |||||
| }); | |||||
| quillInstance.value.root.innerHTML = blog.value.content; | |||||
| editorContent.value = blog.value.content; | |||||
| // ✨ Update content on change | |||||
| quillInstance.value.on("text-change", () => { | |||||
| editorContent.value = quillInstance.value.root.innerHTML; | |||||
| }); | |||||
| } | |||||
| quillInstance.value = new Quill(editor.value, { | |||||
| theme: "snow", | |||||
| modules: { | |||||
| toolbar: [ | |||||
| [{ header: "1" }, { header: "2" }, { font: [] }], | |||||
| [{ list: "ordered" }, { list: "bullet" }], | |||||
| [{ align: [] }], | |||||
| ["bold", "italic", "underline"], | |||||
| ["link", "image"], | |||||
| [{ script: "sub" }, { script: "super" }], | |||||
| [{ direction: "rtl" }], | |||||
| ], | |||||
| }, | |||||
| }); | |||||
| quillInstance.value.root.innerHTML = blog.value.content; | |||||
| editorContent.value = blog.value.content; | |||||
| // ✨ Update content on change | |||||
| quillInstance.value.on("text-change", () => { | |||||
| editorContent.value = quillInstance.value.root.innerHTML; | |||||
| }); | |||||
| } | |||||
| }) | }) | ||||
| .catch((err) => { | .catch((err) => { | ||||
| console.log(err); | console.log(err); | ||||
| @@ -60,17 +60,15 @@ | |||||
| <BCol md="6"> | <BCol md="6"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label class="form-label">توضیحات</label> | |||||
| <textarea | |||||
| v-model="description" | |||||
| class="form-control" | |||||
| placeholder="توضیحات محصول" | |||||
| :class="{ 'is-invalid': errors.description }" | |||||
| @input="clearError('description')" | |||||
| /> | |||||
| <label class="form-label">توضیحات محصول</label> | |||||
| <div | |||||
| @input="clearError('editorContent')" | |||||
| ref="editor" | |||||
| class="quill-editor" | |||||
| ></div> | |||||
| </div> | </div> | ||||
| <small v-if="errors.description" class="text-danger"> | |||||
| {{ errors.description }} | |||||
| <small v-if="errors.editorContent" class="text-danger"> | |||||
| {{ errors.editorContent }} | |||||
| </small> | </small> | ||||
| </BCol> | </BCol> | ||||
| @@ -237,7 +235,7 @@ | |||||
| <BCol v-if="spescial == 1" md="6"> | <BCol v-if="spescial == 1" md="6"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label class="form-label"> تخفیف ویژه </label> | |||||
| <label class="form-label"> تخفیف ویژه درصد</label> | |||||
| <input | <input | ||||
| type="number" | type="number" | ||||
| class="form-control" | class="form-control" | ||||
| @@ -574,10 +572,12 @@ import moment from "jalali-moment"; | |||||
| import { toast } from "vue3-toastify"; | import { toast } from "vue3-toastify"; | ||||
| import "vue3-toastify/dist/index.css"; | import "vue3-toastify/dist/index.css"; | ||||
| import ApiServiece from "@/services/ApiService"; | import ApiServiece from "@/services/ApiService"; | ||||
| import { ref, onMounted, watch, computed } from "vue"; | |||||
| import { ref, onMounted, watch, computed, nextTick } from "vue"; | |||||
| import Layout from "@/layout/custom.vue"; | import Layout from "@/layout/custom.vue"; | ||||
| import DatePicker from "vue3-persian-datetime-picker"; | import DatePicker from "vue3-persian-datetime-picker"; | ||||
| import addIdentity from "@/components/modals/identity/addIdentity.vue"; | import addIdentity from "@/components/modals/identity/addIdentity.vue"; | ||||
| import Quill from "quill"; | |||||
| import "quill/dist/quill.snow.css"; | |||||
| export default { | export default { | ||||
| name: "SAMPLE-PAGE", | name: "SAMPLE-PAGE", | ||||
| @@ -602,7 +602,7 @@ export default { | |||||
| const spescialPrice = ref(); | const spescialPrice = ref(); | ||||
| const wholesalePrice = ref(); | const wholesalePrice = ref(); | ||||
| const retailePrice = ref(); | const retailePrice = ref(); | ||||
| const description = ref(); | |||||
| const productAttributes = ref([]); | const productAttributes = ref([]); | ||||
| const images = ref([{ file: null, preview: null }]); | const images = ref([{ file: null, preview: null }]); | ||||
| const brands = ref(); | const brands = ref(); | ||||
| @@ -623,7 +623,6 @@ export default { | |||||
| const blogCat = ref(); | const blogCat = ref(); | ||||
| const author = ref(""); | const author = ref(""); | ||||
| const editor = ref(null); | const editor = ref(null); | ||||
| const editorContent = ref(""); | const editorContent = ref(""); | ||||
| const getAttributeValues = () => { | const getAttributeValues = () => { | ||||
| @@ -640,8 +639,7 @@ export default { | |||||
| watch(selectedCat, () => { | watch(selectedCat, () => { | ||||
| ApiServiece.get(`admin/attributes?category_id=${selectedCat.value}`) | ApiServiece.get(`admin/attributes?category_id=${selectedCat.value}`) | ||||
| .then((resp) => { | .then((resp) => { | ||||
| relatedAttrebutes.value = resp.data.data; | |||||
| console.log(relatedAttrebutes.value); | |||||
| relatedAttrebutes.value.push(...resp.data.data); | |||||
| }) | }) | ||||
| .catch((err) => { | .catch((err) => { | ||||
| console.log(err); | console.log(err); | ||||
| @@ -652,7 +650,7 @@ export default { | |||||
| ApiServiece.get(`admin/attributes?category_id=${selectedCat.value}`) | ApiServiece.get(`admin/attributes?category_id=${selectedCat.value}`) | ||||
| .then((resp) => { | .then((resp) => { | ||||
| relatedAttrebutes.value = resp.data.data; | relatedAttrebutes.value = resp.data.data; | ||||
| console.log("sadsadsaasdasddsad") | |||||
| console.log("sadsadsaasdasddsad"); | |||||
| }) | }) | ||||
| .catch((err) => { | .catch((err) => { | ||||
| console.log(err); | console.log(err); | ||||
| @@ -781,8 +779,8 @@ export default { | |||||
| if (!image.value) | if (!image.value) | ||||
| errors.value.image = "وارد کردن عکس محصول ضروری می باشد"; | errors.value.image = "وارد کردن عکس محصول ضروری می باشد"; | ||||
| if (!description.value) | |||||
| errors.value.description = "وارد کردن توضیحات محصول ضروری می باشد"; | |||||
| if (!editorContent.value) | |||||
| errors.value.editorContent = "وارد کردن توضیحات محصول ضروری می باشد"; | |||||
| if (!productType.value) | if (!productType.value) | ||||
| errors.value.productType = "انتخاب حالت محصول ضروری می باشد"; | errors.value.productType = "انتخاب حالت محصول ضروری می باشد"; | ||||
| @@ -847,6 +845,36 @@ export default { | |||||
| }; | }; | ||||
| onMounted(() => { | onMounted(() => { | ||||
| const quill = new Quill(editor.value, { | |||||
| theme: "snow", | |||||
| modules: { | |||||
| toolbar: [ | |||||
| [{ header: "1" }, { header: "2" }, { font: [] }], | |||||
| [{ list: "ordered" }, { list: "bullet" }], | |||||
| [{ align: [] }], | |||||
| ["bold", "italic", "underline"], | |||||
| ["link", "image"], | |||||
| [{ script: "sub" }, { script: "super" }], | |||||
| [{ direction: "rtl" }], | |||||
| ], | |||||
| }, | |||||
| }); | |||||
| quill.root.setAttribute("dir", "rtl"); | |||||
| quill.format("direction", "rtl"); | |||||
| nextTick(() => { | |||||
| const rtlButton = quill.container.querySelector( | |||||
| ".ql-direction[data-value='rtl']" | |||||
| ); | |||||
| if (rtlButton) { | |||||
| rtlButton.click(); | |||||
| } | |||||
| }); | |||||
| quill.on("text-change", () => { | |||||
| editorContent.value = quill.root.innerHTML; | |||||
| }); | |||||
| getAttrebuteValues(); | getAttrebuteValues(); | ||||
| getAttributeValues(); | getAttributeValues(); | ||||
| }); | }); | ||||
| @@ -866,7 +894,7 @@ export default { | |||||
| formData.append("title", title.value); | formData.append("title", title.value); | ||||
| formData.append("slug", slug.value); | formData.append("slug", slug.value); | ||||
| formData.append("summary", summary.value); | formData.append("summary", summary.value); | ||||
| formData.append("description", description.value); | |||||
| formData.append("description", editorContent.value); | |||||
| if (isChosen.value == 1) { | if (isChosen.value == 1) { | ||||
| formData.append("is_chosen", isChosen.value); | formData.append("is_chosen", isChosen.value); | ||||
| @@ -988,7 +1016,7 @@ export default { | |||||
| imagePreview.value = null; | imagePreview.value = null; | ||||
| slug.value = ""; | slug.value = ""; | ||||
| summary.value = ""; | summary.value = ""; | ||||
| description.value = ""; | |||||
| editorContent.value = ""; | |||||
| spescial.value = 0; | spescial.value = 0; | ||||
| isChosen.value = 0; | isChosen.value = 0; | ||||
| wholesalePrice.value = ""; | wholesalePrice.value = ""; | ||||
| @@ -1019,6 +1047,7 @@ export default { | |||||
| }) | }) | ||||
| .finally(() => { | .finally(() => { | ||||
| loading.value = false; | loading.value = false; | ||||
| }); | }); | ||||
| }; | }; | ||||
| @@ -1050,7 +1079,6 @@ export default { | |||||
| addImage, | addImage, | ||||
| handleImageUpload, | handleImageUpload, | ||||
| selectedAttributes, | selectedAttributes, | ||||
| description, | |||||
| onCheckboxChange, | onCheckboxChange, | ||||
| retailePrice, | retailePrice, | ||||
| wholesalePrice, | wholesalePrice, | ||||
| @@ -61,19 +61,20 @@ | |||||
| </small> | </small> | ||||
| </BCol> | </BCol> | ||||
| <BCol md="6"> | <BCol md="6"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label class="form-label">توضیحات</label> | |||||
| <textarea | |||||
| v-model="description" | |||||
| class="form-control" | |||||
| placeholder="توضیحات محصول" | |||||
| :class="{ 'is-invalid': errors.description }" | |||||
| @input="clearError('description')" | |||||
| /> | |||||
| <label class="form-label">توضیحات محصول</label> | |||||
| <div | |||||
| @input="clearError('editorContent')" | |||||
| ref="editor" | |||||
| class="quill-editor" | |||||
| ></div> | |||||
| </div> | </div> | ||||
| <small v-if="errors.description" class="text-danger"> | |||||
| {{ errors.description }} | |||||
| <small v-if="errors.editorContent" class="text-danger"> | |||||
| {{ errors.editorContent }} | |||||
| </small> | </small> | ||||
| </BCol> | </BCol> | ||||
| @@ -231,7 +232,7 @@ | |||||
| <BCol v-if="spescial == 1" md="6"> | <BCol v-if="spescial == 1" md="6"> | ||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label class="form-label"> تخفیف ویژه </label> | |||||
| <label class="form-label"> تخفیف ویژه درصد </label> | |||||
| <input | <input | ||||
| type="number" | type="number" | ||||
| class="form-control" | class="form-control" | ||||
| @@ -812,6 +813,8 @@ | |||||
| <script> | <script> | ||||
| import VueSelect from "vue3-select-component"; | import VueSelect from "vue3-select-component"; | ||||
| import Quill from "quill"; | |||||
| import "quill/dist/quill.snow.css"; | |||||
| import Swal from "sweetalert2"; | import Swal from "sweetalert2"; | ||||
| import { useRoute } from "vue-router"; | import { useRoute } from "vue-router"; | ||||
| import { toast } from "vue3-toastify"; | import { toast } from "vue3-toastify"; | ||||
| @@ -844,6 +847,8 @@ export default { | |||||
| attribute_value_id: null, | attribute_value_id: null, | ||||
| }, | }, | ||||
| ]); | ]); | ||||
| const quillInstance = ref(null); | |||||
| const localIdentities = ref([]); | const localIdentities = ref([]); | ||||
| const countInCarton = ref(); | const countInCarton = ref(); | ||||
| const files = ref([]); | const files = ref([]); | ||||
| @@ -1174,8 +1179,8 @@ export default { | |||||
| if (!imagePreview.value) | if (!imagePreview.value) | ||||
| errors.value.image = "وارد کردن عکس محصول ضروری می باشد"; | errors.value.image = "وارد کردن عکس محصول ضروری می باشد"; | ||||
| if (!description.value) | |||||
| errors.value.description = "وارد کردن توضیحات محصول ضروری می باشد"; | |||||
| if (!editorContent.value) | |||||
| errors.value.editorContent = "وارد کردن توضیحات محصول ضروری می باشد"; | |||||
| if (!productType.value) | if (!productType.value) | ||||
| errors.value.productType = "انتخاب حالت محصول ضروری می باشد"; | errors.value.productType = "انتخاب حالت محصول ضروری می باشد"; | ||||
| @@ -1272,6 +1277,31 @@ export default { | |||||
| "YYYY-MM-DD HH:mm:ss" | "YYYY-MM-DD HH:mm:ss" | ||||
| ).format("jYYYY/jMM/jDD HH:mm:ss"); | ).format("jYYYY/jMM/jDD HH:mm:ss"); | ||||
| } | } | ||||
| if (editor.value) { | |||||
| quillInstance.value = new Quill(editor.value, { | |||||
| theme: "snow", | |||||
| modules: { | |||||
| toolbar: [ | |||||
| [{ header: "1" }, { header: "2" }, { font: [] }], | |||||
| [{ list: "ordered" }, { list: "bullet" }], | |||||
| [{ align: [] }], | |||||
| ["bold", "italic", "underline"], | |||||
| ["link", "image"], | |||||
| [{ script: "sub" }, { script: "super" }], | |||||
| [{ direction: "rtl" }], | |||||
| ], | |||||
| }, | |||||
| }); | |||||
| quillInstance.value.root.innerHTML = product.value.description; | |||||
| editorContent.value = product.value.description; | |||||
| quillInstance.value.on("text-change", () => { | |||||
| editorContent.value = quillInstance.value.root.innerHTML; | |||||
| }); | |||||
| } | |||||
| selectedBrand.value = product.value?.brand_id; | selectedBrand.value = product.value?.brand_id; | ||||
| selectedCat.value = product.value?.category_id; | selectedCat.value = product.value?.category_id; | ||||
| @@ -1426,7 +1456,7 @@ export default { | |||||
| formData.append("title", title.value); | formData.append("title", title.value); | ||||
| formData.append("slug", slug.value); | formData.append("slug", slug.value); | ||||
| formData.append("summary", summary.value); | formData.append("summary", summary.value); | ||||
| formData.append("description", description.value); | |||||
| formData.append("description", editorContent.value); | |||||
| if (productType.value == 2 || productType.value == 3) { | if (productType.value == 2 || productType.value == 3) { | ||||
| formData.append("count_in_carton", countInCarton.value); | formData.append("count_in_carton", countInCarton.value); | ||||