%PDF- %PDF-
Direktori : /home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/client/ |
Current File : //home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/client/aa0ed50.js |
(window.webpackJsonp=window.webpackJsonp||[]).push([[31,11],{377:function(t,e,r){"use strict";r.r(e);var n={props:{title:{type:String,required:!0},description:{type:String,required:!1},width:{type:String,required:!1}}},o=r(10),component=Object(o.a)(n,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("section",{staticClass:"bg-gray py-8 md:py-20 px-4 md:px-8 mb-8"},[r("div",{staticClass:"max-w-xl mx-auto w-full"},[r("header",{staticClass:"text-center mb-10"},[r("h2",{staticClass:"text-2xl sm:text-3xl font-bold",class:t.description?"mb-8":""},[t._v(t._s(t.title))]),t._v(" "),t.description?r("p",{staticClass:"text-sm sm:text-base"},[t._v(t._s(t.description))]):t._e()])]),t._v(" "),r("div",{staticClass:"mx-auto w-full",class:t.width?t.width:"max-w-xl"},[t._t("default")],2)])}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{Header:r(101).default})},508:function(t,e,r){"use strict";r.r(e);var n=r(0),o=(r(136),r(11),r(22),r(26),r(3),{data:function(){return{working:!1,photo_url:"",file:"",questions:[]}},mounted:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$axios.$post("/account/profile/questions",{section_id:2}).then((function(e){t.photo_url=e.image_two_url,t.questions=e.questions})).catch((function(e){t.$toast.error(e).goAway(3e3)}));case 2:case"end":return e.stop()}}),e)})))()},methods:{handleFileChange:function(t){var e=this;return Object(n.a)(regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.$refs.provider.validate(t);case 2:n=r.sent,n.valid&&(e.photo_url=URL.createObjectURL(e.$refs.file.files[0]),e.file=e.$refs.file.files[0]);case 5:case"end":return r.stop()}}),r)})))()},save:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.$refs.form.validate().then((function(e){e&&(t.working=!0,t.uploadImage(),t.$axios.$post("/account/profile/questions/create",{questions:t.questions}).then((function(e){t.working=!1,t.$store.dispatch("account/progress/get",{slug:"profile"}),t.$toast.success(e).goAway(1500)})).catch((function(e){t.working=!1,t.$toast.error(e).goAway(1500)})))}));case 1:case"end":return e.stop()}}),e)})))()},uploadImage:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(r=new FormData).append("file",t.file),r.append("prefix","image_two_"),r.append("photo_title",t.form.photo_title),r.append("photo_description",t.form.photo_description),t.working=!0,e.next=8,t.$axios.$post("/account/profile/images/upload",r).then((function(e){t.working=!1})).catch((function(e){t.$toast.error(e).goAway(1500)}));case 8:case"end":return e.stop()}}),e)})))()}}}),l=r(10),component=Object(l.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("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"}},[r("ValidationObserver",{ref:"form"},[r("form",{attrs:{role:"form",method:"POST"},on:{submit:function(e){return e.preventDefault(),t.save(e)}}},[r("ValidationProvider",{ref:"provider",attrs:{rules:"image|size:10000"},scopedSlots:t._u([{key:"default",fn:function(e){e.validate;var n=e.errors;return[r("div",{staticClass:"mb-8 text-center"},[r("label",{staticClass:"w-full cursor-pointer",attrs:{for:"photo-two"}},[t.photo_url?r("div",{staticClass:"rounded-lg overflow-hidden shadow"},[r("img",{staticClass:"w-full",attrs:{src:t.photo_url}})]):r("div",{staticClass:"border border-dashed border-1 border-black border-opacity-20 bg-white p-10 rounded-lg"},[r("span",{staticClass:"text-sm text-black text-opacity-50"},[t._v("Click to add a photo")])]),t._v(" "),r("input",{ref:"file",staticClass:"hidden",attrs:{type:"file",id:"photo-two"},on:{change:function(e){return t.handleFileChange()}}}),t._v(" "),r("span",{staticClass:"mt-4 block uppercase text-blue-light"},[t._v("Upload Photo")])]),t._v(" "),n[0]?r("span",{staticClass:"field-invalid"},[t._v(t._s(n[0]))]):t._e()])]}}])}),t._v(" "),r("div",{staticClass:"max-w-lg w-full mx-auto"},[t._l(t.questions,(function(e,n){return r("div",{key:n},[r("t-input-group",{attrs:{label:e.question}},[1==e.question_type?r("t-input",{model:{value:e.answer,callback:function(r){t.$set(e,"answer",r)},expression:"item.answer"}}):r("t-textarea",{model:{value:e.answer,callback:function(r){t.$set(e,"answer",r)},expression:"item.answer"}})],1)],1)})),t._v(" "),r("div",{staticClass:"flex items-center justify-center"},[r("button",{staticClass:"btn btn-primary rounded-full",attrs:{type:"submit"}},[0==t.working?r("span",[t._v("Save Changes")]):r("span",{staticClass:"flex items-center justify-center"},[r("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"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("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"}})]),t._v(" "),r("span",[t._v("Saving")])])])])],2)],1)])],1)}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{Block:r(377).default})}}]);