PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / trunk
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell vtrunk
3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 2.8.17 2.8.18 All 259 releases
wpfunnels / admin / modules / template-library / Components / SingleStep.vue

SingleStep.vue in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell trunk, at admin/modules/template-library/Components/SingleStep.vue

92 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <template>
2 <div class="wpfnl-step__single-template" v-if="activeStep == step.step_type">
3 <div class="template-preview-image">
4 <div class="importar-loader" v-show="showLoader">
5 <span class="title-wrapper">
6 <span class="title">Importing Step</span>
7 <span class="dot-wrapper">
8 <span class="dot-one">.</span>
9 <span class="dot-two">.</span>
10 <span class="dot-three">.</span>
11 </span>
12 </span>
13 </div>
14
15 <div class="step-image-wrapper" :style="{ backgroundImage: `url(${step.featured_image})` }">
16 <!-- <img :src="step.featured_image" alt="step template" class="template-img step-previw-img"> -->
17 </div>
18 </div>
19
20 <div class="step-template-info">
21 <span class="title">{{step.title ? step.title.rendered : ''}}</span>
22 <div class="template-action">
23 <a :href="step.link" target="_blank" class="step-btn preview"> preview </a>
24 <a href="#" class="step-btn import wpfnl-import-step" :data-funnel-id="funnelID" @click="importStep"> import </a>
25 </div>
26 </div>
27 </div>
28 </template>
29 <script>
30 var j = jQuery.noConflict();
31 import apiFetch from "@wordpress/api-fetch";
32 export default {
33 name: 'SingleStep',
34 props: {
35 step: Object,
36 funnelID: String,
37 activeStep: String,
38 },
39 data: function () {
40 return {
41 showLoader : false,
42 }
43 },
44 methods: {
45 importStep: function (e) {
46 e.preventDefault();
47 j('.wpfnl-create-step_inner-content .not-clickable-overlay').show();
48
49
50 var that = this;
51 this.showLoader = true;
52 that.createStep( {'id' : this.step.id, 'step_type' : this.step.step_type, 'name' : this.step.title ? this.step.title.rendered : this.step.step_type}, this.funnelID, that);
53 },
54 createStep: function (step, funnelID, that) {
55 var that = this,
56 payload = {
57 'step' : step,
58 'funnelID' : funnelID,
59 'source' : 'remote'
60 };
61
62 apiFetch({
63 path: `${window.WPFunnelVars.rest_api_url}wpfunnels/v1/steps/wpfunnel-import-step`,
64 method: 'POST',
65 data: payload
66 })
67 .then(function(response) {
68 that.showLoader = false;
69 that.afterStepCreationRedirect(response.stepID, funnelID);
70 })
71 .catch( function( response ) {
72 that.showLoader = false;
73 });
74 },
75 afterStepCreationRedirect: function (stepID, funnelID) {
76 var payload = {
77 'stepID' : stepID,
78 'funnelID' : funnelID,
79 'source' : 'remote',
80 };
81 wpAjaxHelperRequest( "wpfunnel-after-step-creation", payload )
82 .success( function( response ) {
83 window.location = response.redirectLink
84 })
85 .error( function( response ) {
86 console.log(response)
87 });
88 },
89 }
90 }
91 </script>
92