Ngiler SH3LL 360
Home
Information
Create File
Create Folder
:
/
home
/
tbf
/
tbfguest.tbf.ro
/
src
/
views
/
public
/
sales
/
Information Server
MySQL :
OFF
Perl :
OFF
CURL :
ON
WGET :
OFF
PKEXEC :
OFF
Directive
Local Value
IP Address
89.40.16.97
System
Linux server.atelieruldeit.ro 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64
User
tbf
PHP Version
7.3.33
Software
Apache
Doc root
Writable
close
Edit File :
index.vue
| Size :
9.68
KB
Copy
<!-- @format --> <template> <div class="min-h-screen flex flex-col"> <Navbar /> <div v-if="loaded"> <Transition enter-active-class="ease-out duration-500" enter-from-class="opacity-0" enter-to-class="opacity-100" leave-active-class="ease-in duration-200" leave-from-class="opacity-100" leave-to-class="opacity-0"> <div class="grow bg-gray-50 relative z-10"> <div class="pb-20 pt-10 px-16 space-y-10 divide-y divide-gray-900/10"> <GeneralInformation :productData="product" @updateProduct="updateDataProduct" /> <Caracteristici :productData="product" :isActive="isActiveCharacteristics" :requiredStep="requiredStep" @updateProduct="updateDataProduct" /> <Diferentiere :productData="product" :isActive="isActiveDifferentiations" :requiredStep="requiredStep" @updateProduct="updateDataProduct" /> <Garantii :productData="product" :isActive="isActiveWarranties" :requiredStep="requiredStep" @updateProduct="updateDataProduct" /> <Obiectii :productData="product" :isActive="isActiveObjections" :requiredStep="requiredStep" @updateProduct="updateDataProduct" /> <Oferta :productData="product" :isActive="isActiveOffer" :requiredStep="requiredStep" @updateProduct="updateDataProduct" /> <PublicTinta :options="optionsStepAudience" :productData="product" :isActive="isActiveAudience" :requiredStep="requiredStep" @updateProduct="updateDataProduct" /> <ProdusUpsell :productData="product" :isActive="isActiveProductUpseel" :requiredStep="requiredStep" @updateProduct="updateDataProduct" /> </div> </div> </Transition> </div> <div class="p-16 flex items-center justify-center h-full grow" v-if="!loaded"> <LoadingBigTBF /> </div> </div> </template> <script> import Navbar from "@/components/public/sales/Navbar.vue"; import GeneralInformation from "@/components/public/sales/GeneralInformation.vue"; import Caracteristici from "@/components/public/sales/Caracteristici.vue"; import Diferentiere from "@/components/public/sales/Diferentiere.vue"; import Garantii from "@/components/public/sales/Garantii.vue"; import Obiectii from "@/components/public/sales/Obiectii.vue"; import Oferta from "@/components/public/sales/Oferta.vue"; import PublicTinta from "@/components/public/sales/PublicTinta.vue"; import ProdusUpsell from "@/components/public/sales/ProdusUpsell.vue"; import LoaderProductPage from "@/components/public/sales/loaders/ProductPage.vue"; import { userNotificationsStore } from "@/stores/notifications.js"; import LoadingBigTBF from "../../../components/public/LoadingBigTBF.vue"; export default { components: { Navbar, GeneralInformation, Caracteristici, Diferentiere, Garantii, Obiectii, Oferta, PublicTinta, ProdusUpsell, LoaderProductPage, LoadingBigTBF, }, data() { return { loaded: false, product: {}, requiredStep: {}, optionsStepAudience: [], realTimeNotifications: userNotificationsStore(), stepsChecked: [false, false, false, false, false, false, false], }; }, computed: { isActiveCharacteristics() { return this.checkActiveStep("characteristics"); }, isActiveDifferentiations() { return this.checkActiveStep("differentiations"); }, isActiveWarranties() { return this.checkActiveStep("warranties"); }, isActiveObjections() { return this.checkActiveStep("objections"); }, isActiveOffer() { return this.checkActiveStep("offer"); }, isActiveAudience() { return this.checkActiveStep("audience"); }, isActiveProductUpseel() { return this.checkActiveStep("product_upsell"); }, }, async mounted() { await this.getOptions(); if (this.$auth.user().product_id) { await this.getProductInformation(); } }, methods: { async getOptions() { await axios .get(`options?type=audience`) .then(({ data }) => { this.optionsStepAudience = data.data; }) .catch((error) => { var responseError = error.response.data; this.realTimeNotifications.addNotification({ type: "error", title: "TBF ERROR", description: `"${responseError.message}"<br>Vă rugăm să ne contactați și să ne transmiteți eroare. În interesul remedierii acestei probleme cât mai curând posibil.`, }); }) .finally(() => { if (!this.$auth.user().product_id) { this.loaded = true; } }); }, async getProductInformation() { await axios .get(`instances/${this.$auth.user().instance.id}/products/${this.$auth.user().product_id}/edit`) .then(({ data }) => { this.product = data.data; }) .catch((error) => { var responseError = error.response.data; this.realTimeNotifications.addNotification({ type: "error", title: "TBF ERROR", description: `"${responseError.message}"<br>Vă rugăm să ne contactați și să ne transmiteți eroare. În interesul remedierii acestei probleme cât mai curând posibil.`, }); }) .finally(() => { this.loaded = true; }); }, checkActiveStep(step) { let steps = [ { function: "checkStep1", step: "Informații Generale Produs", customMsg: "" }, { function: "checkStep2", step: "Caracteristicile Produsului", customMsg: '<br /><span class="font-semibold">Minim 10 caracteristici.</span>' }, { function: "checkStep3", step: "Diferențierea Produsului", customMsg: '<br /><span class="font-semibold">Minim 3 puncte de diferențiere.</span>' }, { function: "checkStep4", step: "Garanțiile Oferite", customMsg: '<br /><span class="font-semibold">Minim 3 garanții.</span>' }, { function: "checkStep5", step: "Obiecțiile clienților", customMsg: '<br /><span class="font-semibold">Minim 3 obiecții.</span>' }, { function: "checkStep6", step: "Ofertă produs principal", customMsg: "" }, { function: "checkStep7", step: "Public țintă", customMsg: "" }, ]; switch (step) { case "characteristics": if (!this[steps[0].function]()) { this.stepsChecked[0] = true; this.requiredStep = { step: steps[0].step, message: steps[0].customMsg }; } else { this.stepsChecked[0] = true; return true; } break; case "differentiations": var stepCompleted = true; for (let i = 0; i < 2; i++) { if (!this[steps[i].function]()) { stepCompleted = false; this.requiredStep = { step: steps[i].step, message: steps[i].customMsg }; this.stepsChecked[1] = true; break; } } this.stepsChecked[1] = true; if (stepCompleted) { return true; } break; case "warranties": var stepCompleted = true; for (let i = 0; i < 3; i++) { if (!this[steps[i].function]()) { stepCompleted = false; this.requiredStep = { step: steps[i].step, message: steps[i].customMsg }; this.stepsChecked[2] = true; break; } } this.stepsChecked[2] = true; if (stepCompleted) { return true; } break; case "objections": var stepCompleted = true; for (let i = 0; i < 4; i++) { if (!this[steps[i].function]()) { stepCompleted = false; this.requiredStep = { step: steps[i].step, message: steps[i].customMsg }; this.stepsChecked[3] = true; break; } } this.stepsChecked[3] = true; if (stepCompleted) { return true; } break; case "offer": var stepCompleted = true; for (let i = 0; i < 5; i++) { if (!this[steps[i].function]()) { stepCompleted = false; this.requiredStep = { step: steps[i].step, message: steps[i].customMsg }; this.stepsChecked[4] = true; break; } } this.stepsChecked[4] = true; if (stepCompleted) { return true; } break; case "audience": var stepCompleted = true; for (let i = 0; i < 6; i++) { if (!this[steps[i].function]()) { stepCompleted = false; this.requiredStep = { step: steps[i].step, message: steps[i].customMsg }; this.stepsChecked[5] = true; break; } } this.stepsChecked[5] = true; if (stepCompleted) { return true; } break; case "product_upsell": var stepCompleted = true; for (let i = 0; i < 7; i++) { if (!this[steps[i].function]()) { stepCompleted = false; this.requiredStep = { step: steps[i].step, message: steps[i].customMsg }; this.stepsChecked[6] = true; break; } } this.stepsChecked[6] = true; if (stepCompleted) { return true; } break; } return false; }, updateDataProduct(data) { this.product = data; }, checkStep1() { // General information step if (this.product.name && this.product.description && this.product.brand && this.product.market_segment) { return true; } else { return false; } }, checkStep2() { // Characteristic steps if (this.product.characteristics && this.product.characteristics.length > 9) { return true; } else { return false; } }, checkStep3() { // Differentations step if (this.product.differentiations && this.product.differentiations.length > 2) { return true; } else { return false; } }, checkStep4() { // Warranties step if (this.product.warranties && this.product.warranties.length > 2) { return true; } else { return false; } }, checkStep5() { // Objections step if (this.product.objections && this.product.objections.length > 2) { return true; } else { return false; } }, checkStep6() { // Product Offer step if (this.product.offer && this.product.offer.length == 4) { return true; } else { return false; } }, checkStep7() { // Product Audience step if (this.product.audience) { return true; } else { return false; } }, }, }; </script>
Back