%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/server/components/
Upload File :
Create Path :
Current File : //home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/server/components/question-section-two.js

exports.ids = [30,10];
exports.modules = {

/***/ 131:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/slots/Block.vue?vue&type=template&id=0e972406&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('section',{staticClass:"bg-gray py-8 md:py-20 px-4 md:px-8 mb-8"},[_vm._ssrNode("<div class=\"max-w-xl mx-auto w-full\"><header class=\"text-center mb-10\"><h2"+(_vm._ssrClass("text-2xl sm:text-3xl font-bold",_vm.description ? 'mb-8' : ''))+">"+_vm._ssrEscape(_vm._s(_vm.title))+"</h2> "+((_vm.description)?("<p class=\"text-sm sm:text-base\">"+_vm._ssrEscape(_vm._s(_vm.description))+"</p>"):"<!---->")+"</header></div> "),_vm._ssrNode("<div"+(_vm._ssrClass("mx-auto w-full",_vm.width ? _vm.width : 'max-w-xl'))+">","</div>",[_vm._t("default")],2)],2)}
var staticRenderFns = []


// CONCATENATED MODULE: ./components/slots/Block.vue?vue&type=template&id=0e972406&

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/slots/Block.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var Blockvue_type_script_lang_js_ = ({
  props: {
    title: {
      type: String,
      required: true
    },
    description: {
      type: String,
      required: false
    },
    width: {
      type: String,
      required: false
    }
  }
});
// CONCATENATED MODULE: ./components/slots/Block.vue?vue&type=script&lang=js&
 /* harmony default export */ var slots_Blockvue_type_script_lang_js_ = (Blockvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./components/slots/Block.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  slots_Blockvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "127f880a"
  
)

/* harmony default export */ var Block = __webpack_exports__["default"] = (component.exports);

/* nuxt-component-imports */
installComponents(component, {Header: __webpack_require__(12).default})


/***/ }),

/***/ 175:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* WEBPACK VAR INJECTION */(function(URL) {//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ __webpack_exports__["a"] = ({
  data() {
    return {
      working: false,
      photo_url: '',
      file: '',
      questions: []
    };
  },

  async mounted() {
    await this.$axios.$post('/account/profile/questions', {
      section_id: 2
    }).then(response => {
      this.photo_url = response.image_two_url;
      this.questions = response.questions;
    }).catch(error => {
      this.$toast.error(error).goAway(3000);
    });
  },

  methods: {
    async handleFileChange(e) {
      const {
        valid
      } = await this.$refs.provider.validate(e);

      if (valid) {
        this.photo_url = URL.createObjectURL(this.$refs.file.files[0]);
        this.file = this.$refs.file.files[0];
      }
    },

    async save() {
      this.$refs.form.validate().then(success => {
        if (!success) {
          return;
        }

        this.working = true;
        this.uploadImage();
        this.$axios.$post('/account/profile/questions/create', {
          questions: this.questions
        }).then(response => {
          this.working = false;
          this.$store.dispatch('account/progress/get', {
            slug: 'profile'
          });
          this.$toast.success(response).goAway(1500);
        }).catch(error => {
          this.working = false;
          this.$toast.error(error).goAway(1500);
        });
      });
    },

    async uploadImage() {
      let formData = new FormData();
      formData.append('file', this.file);
      formData.append('prefix', 'image_two_');
      formData.append('photo_title', this.form.photo_title);
      formData.append('photo_description', this.form.photo_description);
      this.working = true;
      await this.$axios.$post('/account/profile/images/upload', formData).then(response => {
        this.working = false;
      }).catch(error => {
        this.$toast.error(error).goAway(1500);
      });
    }

  }
});
/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(130)["URL"]))

/***/ }),

/***/ 268:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/blocks/Account/profile/QuestionSectionTwo.vue?vue&type=template&id=cafb7d5a&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('Block',{attrs:{"title":"And finally…","description":"These questions are optional and aim to bring you more to life as a person. We feel this will help clients when choosing to work with you.","width":"max-w-5xl"}},[_c('ValidationObserver',{ref:"form"},[_c('form',{attrs:{"role":"form","method":"POST"},on:{"submit":function($event){$event.preventDefault();return _vm.save($event)}}},[_c('ValidationProvider',{ref:"provider",attrs:{"rules":"image|size:10000"},scopedSlots:_vm._u([{key:"default",fn:function(ref){
var validate = ref.validate;
var errors = ref.errors;
return [_c('div',{staticClass:"mb-8 text-center"},[_c('label',{staticClass:"w-full cursor-pointer",attrs:{"for":"photo-two"}},[(_vm.photo_url)?_c('div',{staticClass:"rounded-lg overflow-hidden shadow"},[_c('img',{staticClass:"w-full",attrs:{"src":_vm.photo_url}})]):_c('div',{staticClass:"border border-dashed border-1 border-black border-opacity-20 bg-white p-10 rounded-lg"},[_c('span',{staticClass:"text-sm text-black text-opacity-50"},[_vm._v("Click to add a photo")])]),_vm._v(" "),_c('input',{ref:"file",staticClass:"hidden",attrs:{"type":"file","id":"photo-two"},on:{"change":function($event){return _vm.handleFileChange()}}}),_vm._v(" "),_c('span',{staticClass:"mt-4 block uppercase text-blue-light"},[_vm._v("Upload Photo")])]),_vm._v(" "),(errors[0])?_c('span',{staticClass:"field-invalid"},[_vm._v(_vm._s(errors[0]))]):_vm._e()])]}}])}),_vm._v(" "),_c('div',{staticClass:"max-w-lg w-full mx-auto"},[_vm._l((_vm.questions),function(item,key){return _c('div',{key:key},[_c('t-input-group',{attrs:{"label":item.question}},[(item.question_type == 1)?_c('t-input',{model:{value:(item.answer),callback:function ($$v) {_vm.$set(item, "answer", $$v)},expression:"item.answer"}}):_c('t-textarea',{model:{value:(item.answer),callback:function ($$v) {_vm.$set(item, "answer", $$v)},expression:"item.answer"}})],1)],1)}),_vm._v(" "),_c('div',{staticClass:"flex items-center justify-center"},[_c('button',{staticClass:"btn btn-primary rounded-full",attrs:{"type":"submit"}},[(_vm.working == false)?_c('span',[_vm._v("Save Changes")]):_c('span',{staticClass:"flex items-center justify-center"},[_c('svg',{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{"xmlns":"http://www.w3.org/2000/svg","fill":"none","viewBox":"0 0 24 24"}},[_c('circle',{staticClass:"opacity-25",attrs:{"cx":"12","cy":"12","r":"10","stroke":"currentColor","stroke-width":"4"}}),_vm._v(" "),_c('path',{staticClass:"opacity-75",attrs:{"fill":"currentColor","d":"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),_vm._v(" "),_c('span',[_vm._v("Saving")])])])])],2)],1)])],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./components/blocks/Account/profile/QuestionSectionTwo.vue?vue&type=template&id=cafb7d5a&

// EXTERNAL MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/blocks/Account/profile/QuestionSectionTwo.vue?vue&type=script&lang=js&
var QuestionSectionTwovue_type_script_lang_js_ = __webpack_require__(175);

// CONCATENATED MODULE: ./components/blocks/Account/profile/QuestionSectionTwo.vue?vue&type=script&lang=js&
 /* harmony default export */ var profile_QuestionSectionTwovue_type_script_lang_js_ = (QuestionSectionTwovue_type_script_lang_js_["a" /* default */]); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(1);

// CONCATENATED MODULE: ./components/blocks/Account/profile/QuestionSectionTwo.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  profile_QuestionSectionTwovue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  "ecf2ce74"
  
)

/* harmony default export */ var QuestionSectionTwo = __webpack_exports__["default"] = (component.exports);

/* nuxt-component-imports */
installComponents(component, {Block: __webpack_require__(131).default})


/***/ })

};;
//# sourceMappingURL=question-section-two.js.map

Zerion Mini Shell 1.0