| @@ -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"); | |||
| if (faviconUrl) { | |||
| const faviconLink = document.getElementById("favicon"); | |||
| @@ -32,7 +32,7 @@ | |||
| @input="clearError('title')" | |||
| type="text" | |||
| class="form-control" | |||
| placeholder="عنوان برند" | |||
| placeholder="عنوان دسته" | |||
| :class="{ 'is-invalid': errors.title }" | |||
| /> | |||
| <small v-if="errors.title" class="text-danger"> | |||
| @@ -86,7 +86,7 @@ | |||
| @input="clearError('description')" | |||
| type="text" | |||
| class="form-control" | |||
| placeholder="توضیحات برند" | |||
| placeholder="توضیحات دسته" | |||
| :class="{ 'is-invalid': errors.description }" | |||
| ></textarea> | |||
| <small v-if="errors.description" class="text-danger"> | |||
| @@ -25,13 +25,13 @@ | |||
| <!-- Brand Title --> | |||
| <BCol lg="6"> | |||
| <div class="form-group"> | |||
| <label class="form-label">عنوان برند</label> | |||
| <label class="form-label">عنوان دسته</label> | |||
| <input | |||
| v-model="localTitle" | |||
| @input="clearError('localTitle')" | |||
| type="text" | |||
| class="form-control" | |||
| placeholder="عنوان برند" | |||
| placeholder="عنوان دسته" | |||
| :class="{ 'is-invalid': errors.localTitle }" | |||
| /> | |||
| <small v-if="errors.localTitle" class="text-danger"> | |||
| @@ -43,7 +43,7 @@ | |||
| <!-- Brand Image Upload --> | |||
| <BCol lg="6"> | |||
| <div class="form-group"> | |||
| <label class="form-label">تصویر برند</label> | |||
| <label class="form-label">تصویر دسته</label> | |||
| <input | |||
| type="file" | |||
| @@ -73,13 +73,13 @@ | |||
| <!-- Brand Description --> | |||
| <BCol lg="12"> | |||
| <div class="form-group"> | |||
| <label class="form-label">توضیحات برند</label> | |||
| <label class="form-label">توضیحات دسته</label> | |||
| <textarea | |||
| v-model="localDesc" | |||
| @input="clearError('localDesc')" | |||
| type="text" | |||
| class="form-control" | |||
| placeholder="توضیحات برند" | |||
| placeholder="توضیحات دسته" | |||
| :class="{ 'is-invalid': errors.localDesc }" | |||
| ></textarea> | |||
| <small v-if="errors.localDesc" class="text-danger"> | |||
| @@ -203,7 +203,7 @@ export default { | |||
| const handleSearch = async (searchTerm) => { | |||
| if (searchTerm.length < 3) return; | |||
| categorySelectorLoader.value = true; | |||
| try { | |||
| @@ -271,29 +271,29 @@ export default { | |||
| blogCat.value = blog.value.blog_category_id; | |||
| author.value = blog.value.author; | |||
| 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) => { | |||
| console.log(err); | |||
| @@ -60,17 +60,15 @@ | |||
| <BCol md="6"> | |||
| <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> | |||
| <small v-if="errors.description" class="text-danger"> | |||
| {{ errors.description }} | |||
| <small v-if="errors.editorContent" class="text-danger"> | |||
| {{ errors.editorContent }} | |||
| </small> | |||
| </BCol> | |||
| @@ -237,7 +235,7 @@ | |||
| <BCol v-if="spescial == 1" md="6"> | |||
| <div class="form-group"> | |||
| <label class="form-label"> تخفیف ویژه </label> | |||
| <label class="form-label"> تخفیف ویژه درصد</label> | |||
| <input | |||
| type="number" | |||
| class="form-control" | |||
| @@ -574,10 +572,12 @@ import moment from "jalali-moment"; | |||
| import { toast } from "vue3-toastify"; | |||
| import "vue3-toastify/dist/index.css"; | |||
| 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 DatePicker from "vue3-persian-datetime-picker"; | |||
| import addIdentity from "@/components/modals/identity/addIdentity.vue"; | |||
| import Quill from "quill"; | |||
| import "quill/dist/quill.snow.css"; | |||
| export default { | |||
| name: "SAMPLE-PAGE", | |||
| @@ -602,7 +602,7 @@ export default { | |||
| const spescialPrice = ref(); | |||
| const wholesalePrice = ref(); | |||
| const retailePrice = ref(); | |||
| const description = ref(); | |||
| const productAttributes = ref([]); | |||
| const images = ref([{ file: null, preview: null }]); | |||
| const brands = ref(); | |||
| @@ -623,7 +623,6 @@ export default { | |||
| const blogCat = ref(); | |||
| const author = ref(""); | |||
| const editor = ref(null); | |||
| const editorContent = ref(""); | |||
| const getAttributeValues = () => { | |||
| @@ -640,8 +639,7 @@ export default { | |||
| watch(selectedCat, () => { | |||
| ApiServiece.get(`admin/attributes?category_id=${selectedCat.value}`) | |||
| .then((resp) => { | |||
| relatedAttrebutes.value = resp.data.data; | |||
| console.log(relatedAttrebutes.value); | |||
| relatedAttrebutes.value.push(...resp.data.data); | |||
| }) | |||
| .catch((err) => { | |||
| console.log(err); | |||
| @@ -652,7 +650,7 @@ export default { | |||
| ApiServiece.get(`admin/attributes?category_id=${selectedCat.value}`) | |||
| .then((resp) => { | |||
| relatedAttrebutes.value = resp.data.data; | |||
| console.log("sadsadsaasdasddsad") | |||
| console.log("sadsadsaasdasddsad"); | |||
| }) | |||
| .catch((err) => { | |||
| console.log(err); | |||
| @@ -781,8 +779,8 @@ export default { | |||
| if (!image.value) | |||
| errors.value.image = "وارد کردن عکس محصول ضروری می باشد"; | |||
| if (!description.value) | |||
| errors.value.description = "وارد کردن توضیحات محصول ضروری می باشد"; | |||
| if (!editorContent.value) | |||
| errors.value.editorContent = "وارد کردن توضیحات محصول ضروری می باشد"; | |||
| if (!productType.value) | |||
| errors.value.productType = "انتخاب حالت محصول ضروری می باشد"; | |||
| @@ -847,6 +845,36 @@ export default { | |||
| }; | |||
| 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(); | |||
| getAttributeValues(); | |||
| }); | |||
| @@ -866,7 +894,7 @@ export default { | |||
| formData.append("title", title.value); | |||
| formData.append("slug", slug.value); | |||
| formData.append("summary", summary.value); | |||
| formData.append("description", description.value); | |||
| formData.append("description", editorContent.value); | |||
| if (isChosen.value == 1) { | |||
| formData.append("is_chosen", isChosen.value); | |||
| @@ -988,7 +1016,7 @@ export default { | |||
| imagePreview.value = null; | |||
| slug.value = ""; | |||
| summary.value = ""; | |||
| description.value = ""; | |||
| editorContent.value = ""; | |||
| spescial.value = 0; | |||
| isChosen.value = 0; | |||
| wholesalePrice.value = ""; | |||
| @@ -1019,6 +1047,7 @@ export default { | |||
| }) | |||
| .finally(() => { | |||
| loading.value = false; | |||
| }); | |||
| }; | |||
| @@ -1050,7 +1079,6 @@ export default { | |||
| addImage, | |||
| handleImageUpload, | |||
| selectedAttributes, | |||
| description, | |||
| onCheckboxChange, | |||
| retailePrice, | |||
| wholesalePrice, | |||
| @@ -61,19 +61,20 @@ | |||
| </small> | |||
| </BCol> | |||
| <BCol md="6"> | |||
| <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> | |||
| <small v-if="errors.description" class="text-danger"> | |||
| {{ errors.description }} | |||
| <small v-if="errors.editorContent" class="text-danger"> | |||
| {{ errors.editorContent }} | |||
| </small> | |||
| </BCol> | |||
| @@ -231,7 +232,7 @@ | |||
| <BCol v-if="spescial == 1" md="6"> | |||
| <div class="form-group"> | |||
| <label class="form-label"> تخفیف ویژه </label> | |||
| <label class="form-label"> تخفیف ویژه درصد </label> | |||
| <input | |||
| type="number" | |||
| class="form-control" | |||
| @@ -812,6 +813,8 @@ | |||
| <script> | |||
| import VueSelect from "vue3-select-component"; | |||
| import Quill from "quill"; | |||
| import "quill/dist/quill.snow.css"; | |||
| import Swal from "sweetalert2"; | |||
| import { useRoute } from "vue-router"; | |||
| import { toast } from "vue3-toastify"; | |||
| @@ -844,6 +847,8 @@ export default { | |||
| attribute_value_id: null, | |||
| }, | |||
| ]); | |||
| const quillInstance = ref(null); | |||
| const localIdentities = ref([]); | |||
| const countInCarton = ref(); | |||
| const files = ref([]); | |||
| @@ -1174,8 +1179,8 @@ export default { | |||
| if (!imagePreview.value) | |||
| errors.value.image = "وارد کردن عکس محصول ضروری می باشد"; | |||
| if (!description.value) | |||
| errors.value.description = "وارد کردن توضیحات محصول ضروری می باشد"; | |||
| if (!editorContent.value) | |||
| errors.value.editorContent = "وارد کردن توضیحات محصول ضروری می باشد"; | |||
| if (!productType.value) | |||
| errors.value.productType = "انتخاب حالت محصول ضروری می باشد"; | |||
| @@ -1272,6 +1277,31 @@ export default { | |||
| "YYYY-MM-DD 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; | |||
| selectedCat.value = product.value?.category_id; | |||
| @@ -1426,7 +1456,7 @@ export default { | |||
| formData.append("title", title.value); | |||
| formData.append("slug", slug.value); | |||
| formData.append("summary", summary.value); | |||
| formData.append("description", description.value); | |||
| formData.append("description", editorContent.value); | |||
| if (productType.value == 2 || productType.value == 3) { | |||
| formData.append("count_in_carton", countInCarton.value); | |||