/
home
/
henzagold
/
customerB
/
export
/
js
/
File Upload :
llllll
Current File: /home/henzagold/customerB/export/js/chunk-b906e39a.4b9894fb.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b906e39a"],{"55fc":function(e,t,o){e.exports=o.p+"img/login.66c23784.jpg"},6089:function(e,t,o){},"76f2":function(e,t,o){"use strict";var r=function(){var e=this,t=e._self._c;return t("div",{staticClass:"login-style-2"},[t("div",{staticClass:"container"},[t("div",{staticClass:"acr-auth-container"},[t("div",{staticClass:"acr-auth-content"},[e._t("default")],2),t("div",{staticClass:"acr-auth-bg bg-cover bg-center dark-overlay dark-overlay-2",style:"background: "+e.url})])])])},n=[],s={data(){return{url:`url(${o("55fc")})`}}},i=s,a=(o("e4c7"),o("2877")),l=Object(a["a"])(i,r,n,!1,null,"0ed357dd",null);t["a"]=l.exports},b5be:function(e,t,o){"use strict";o.r(t);var r=function(){var e=this,t=e._self._c;return t("login",[t("form",[t("div",{staticClass:"auth-text"},[t("h3",[e._v("به هنزاگلد خوش آمدید")])]),e.Token_Flag?e._e():t("div",[t("div",{staticClass:"form-group"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.Phone,expression:"Phone"}],staticClass:"form-control form-control-light",attrs:{name:"Phone",type:"text",placeholder:"شماره تلفن"},domProps:{value:e.Phone},on:{"~keyup":function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.Send_Phone.apply(null,arguments))},blur:e.Blur,input:function(t){t.target.composing||(e.Phone=t.target.value)}}})]),e.Alert?t("span",{staticClass:"text-danger text-sm",staticStyle:{"margin-right":".5rem"}},[e._v(" "+e._s(e.Alert)+" ")]):e._e(),t("button",{staticClass:"btn-custom secondary btn-block",on:{click:function(t){return t.preventDefault(),e.Send_Phone.apply(null,arguments)}}},[e._v("ارسال")]),t("div",{staticClass:"auth-seperator"},[t("span")])]),e.Token_Flag?t("div",[t("div",{staticClass:"form-group"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.Token,expression:"Token"}],staticClass:"form-control form-control-light",attrs:{name:"token",id:"one-time-code",type:"text",placeholder:"کد ارسال شده"},domProps:{value:e.Token},on:{"~keyup":function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:(t.preventDefault(),e.Send_Token.apply(null,arguments))},input:function(t){t.target.composing||(e.Token=t.target.value)}}})]),t("div",{staticClass:"text-center"},[t("a",{attrs:{href:"#"},on:{click:e.Change_Phone}},[e._v("تغییر شماره همراه")]),e._v(" / "),e.Timer>0?t("div",{staticClass:"toltip",staticStyle:{display:"inline"}},[t("span",{staticClass:"toltiptext"},[e._v("لطفا تا اتمام تایمر صبر کنید")]),e._v(" ارسال مجدد کد تایید ")]):t("a",{attrs:{href:"#"},on:{click:function(t){return t.preventDefault(),e.Send_Phone.apply(null,arguments)}}},[e._v("ارسال مجدد کد تایید")]),t("p",{staticClass:"center"},[e._v("( 00:"+e._s(e.Timer)+" )")])]),t("button",{staticClass:"btn-custom secondary btn-block",on:{click:function(t){return t.preventDefault(),e.Send_Token.apply(null,arguments)}}},[e._v("ورود")]),t("div",{staticClass:"auth-seperator"},[t("span")])]):e._e(),t("div",{staticClass:"social-login"},[t("a",{staticClass:"btn-custom secondary btn-block",attrs:{href:"https://henzagold.com/"}},[e._v(" بازگشت به فروشگاه ")])]),t("p",{staticClass:"text-center mb-0"},[e._v("آیا شما ثبت نام نکرده اید ؟ "),t("router-link",{attrs:{to:"/register"}},[e._v("ساخت حساب کاربری")])],1)])])},n=[],s=(o("14d9"),o("be3b")),i=o("76f2"),a={props:{togglePreLoader:Function},components:{login:i["a"]},data(){return{Phone:null,Token:null,Alert:"",Is_Phone_Correct:!1,Token_Flag:!1,Data:null,Timer:0,Error:null,requestFlag:!0}},methods:{checkRoute(){this.$route.query.outerRoute?window.location.href=this.$route.query.outerRoute:this.$route.query.innerRoute?this.$router.push("/"+this.$route.query.innerRoute):this.$router.push("/my-orders")},Change_Phone(){this.Token_Flag=!this.Token_Flag,this.Phone=null},async Send_Token(){try{if(this.Token&&this.requestFlag){this.requestFlag=!1,this.togglePreLoader("open");let{data:e}=await Object(s["a"])({method:"post",url:"/cu/verfiy/token",headers:{},data:{id:this.Data["id"],token:this.Token}});this.Data=e,this.Token_Flag=!0,localStorage.setItem("accessToken",e["api_token"]),localStorage.setItem("userInfo",JSON.stringify(e)),this.checkRoute()}}catch(e){if(e.response&&e.response.data.errors){let t="";for(let o of Object.values(e.response.data.errors))o.map(e=>{e.includes("shipping address")?t+=e.replace("shipping address","آدرس")+"<br/>":t+=e+"<br/>"});this.$vs.notify({title:"خطایی رخ داد",time:3500,text:t,color:"var(--secondary-color)",icon:"error_outline"})}else e&&("Error: Network Error"==e?this.$vs.notify({title:"خطایی رخ داد",time:3500,text:"اتصال برقرار نشد",color:"var(--secondary-color)",icon:"error_outline"}):this.$vs.notify({title:"خطایی رخ داد",time:3500,text:"کد تایید وارد شده اشتباه است",color:"var(--secondary-color)",icon:"error_outline"}))}finally{this.togglePreLoader("close"),this.requestFlag=!0}},async Send_Phone(){try{if(this.requestFlag&&(this.Is_Phone_Correct||/^(\+98|0098|98|0)?9\d{9}$/g.test(this.Phone))){this.requestFlag=!1,this.togglePreLoader("open");let{data:e}=await Object(s["a"])({method:"post",url:"/cu/login",headers:{useCredentails:!0},data:{phone:this.Phone}});this.Data=e,this.Token_Flag=!0,this.Timer=60,this.countDownTimer(),this.Otp_Checker()}else this.$vs.notify({time:3500,text:"شماره تلفن همراه را وارد نمایید",color:"var(--secondary-color)",icon:"error_outline"})}catch(e){if(e.response&&e.response.data.errors){let t="";for(let o of Object.values(e.response.data.errors))o.map(e=>{e.includes("shipping address")?t+=e.replace("shipping address","آدرس")+"<br/>":t+=e+"<br/>"});this.$vs.notify({title:"خطایی رخ داد",time:3500,text:t,color:"var(--secondary-color)",icon:"error_outline"})}else e&&("Error: Network Error"==e?this.$vs.notify({title:"خطایی رخ داد",time:3500,text:"اتصال برقرار نشد",color:"var(--secondary-color)",icon:"error_outline"}):this.$vs.notify({title:"خطایی رخ داد",time:3500,text:"ثبت نام نکرده اید . لطفا ثبت نام کنید",color:"var(--secondary-color)",icon:"error_outline"}))}finally{this.requestFlag=!0,this.togglePreLoader("close")}},Otp_Checker(){"OTPCredential"in window&&window.addEventListener("DOMContentLoaded",this.getOtp())},Blur(){const e=/^(\+98|0098|98|0)?9\d{9}$/g;this.Phone?!0!==e.test(this.Phone)?(this.Alert="تلفن همراه وارد شده نامعتبر می باشد",this.Is_Phone_Correct=!1):(this.Is_Phone_Correct=!0,this.Alert=""):(this.Alert="وارد کردن تلفن همراه الزامی است",this.Is_Phone_Correct=!1)},countDownTimer(){this.Timer>0&&setTimeout(()=>{this.Timer>0&&(this.Timer-=1,this.countDownTimer())},1e3)},getOtp(){const e=document.querySelector("#one-time-code");if(!e)return;const t=new AbortController,o=e.closest("form");o&&o.addEventListener("submit",(function(){t.abort()})),navigator.credentials.get({otp:{transport:["sms"]},signal:t.signal}).then(t=>{e.value=t.code,o&&this.Send_Token()}).catch(e=>{console.log(e)})}},beforeDestroy(){window.removeEventListener("DOMContentLoaded",this.getOtp())}},l=a,c=o("2877"),u=Object(c["a"])(l,r,n,!1,null,null,null);t["default"]=u.exports},e4c7:function(e,t,o){"use strict";o("6089")}}]); //# sourceMappingURL=chunk-b906e39a.4b9894fb.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure