/
home
/
henzagold
/
customerB
/
export
/
js
/
File Upload :
llllll
Current File: /home/henzagold/customerB/export/js/chunk-6f674716.a119215c.js
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6f674716"],{5677:function(t,e,s){},"5afc":function(t,e,s){"use strict";s("5677")},aff5:function(t,e,s){"use strict";var r=function(){var t=this,e=t._self._c;return e("div",{staticClass:"modal quick-view-modal",class:t.m?"fade-in show":"fade",staticStyle:{display:"block"},attrs:{role:"dialog"}},[e("div",{staticClass:"vs-sidebar--background",on:{click:function(e){t.m=!1}}}),e("div",{staticClass:"modal-dialog modal-lg modal-dialog-centered",attrs:{role:"document"}},[e("div",{staticClass:"modal-content",style:{maxWidth:t.maxWidth}},[e("div",{staticClass:"modal-body"},[e("div",{staticClass:"close-btn close-dark",on:{click:function(e){t.m=!1}}},[e("span"),e("span")]),e("h4",{staticClass:"center",staticStyle:{padding:"8px","font-size":"1.2rem","margin-bottom":"0"}},[t._t("header")],2),t._t("body")],2)])])])},a=[],i={props:{maxWidth:{required:!1,type:String},model:{type:Boolean,default:!1}},model:{prop:"model",event:"change"},watch:{model(t){t||(console.log(close),this.$emit("close"))}},computed:{m:{get:function(){return this.model},set:function(t){document.body.classList.toggle("modal-open"),this.$emit("change",t)}}}},o=i,l=s("2877"),n=Object(l["a"])(o,r,a,!1,null,null,null);e["a"]=n.exports},f3cb:function(t,e,s){"use strict";s.r(e);s("14d9");var r=function(){var t=this,e=t._self._c;return e("div",[t.Items&&t.Items.length>0?e("div",{staticClass:"container"},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-12"},[e("div",{staticClass:"checkout-table"},[e("table",{staticClass:"products_table"},[t._m(0),e("tbody",t._l(t.Items,(function(s,r){return e("tr",{key:r},[e("td",{staticClass:"remove",attrs:{"data-title":"حذف "}},[e("div",{staticClass:"product-remove"},[e("a",{staticClass:"close-btn close-dark",attrs:{href:"#"},on:{click:function(e){return t.Remove(r)}}},[e("span"),e("span")])])]),e("td",{staticClass:"toltip",attrs:{"data-title":"محصول "}},[e("a",{attrs:{href:`https://henzagold.com/product/${s.product.title.split(" ").join("-")}/${s.pid}`,target:"_blank"}},[t.getVariant(t.Items[r]).is_pre_order?e("span",{staticClass:"toltiptext"},[t._v(" این محصول به صورت پیش فروش است ")]):t._e(),e("div",{staticClass:"product-box"},[e("img",{attrs:{src:t.Items[r].product.image.image,alt:"product"}}),e("div",{staticClass:"product-name"},[e("h6",[t._v(" "+t._s(t.Items[r].product.title)+" ")])])])])]),e("td",{staticClass:"center",attrs:{"data-title":"قیمت واحد "}},[t.showBeforePrice(s)?e("div",{staticClass:"line-through mb-2"},[t._v(" "+t._s(t._f("priceUnit")(t.getVariant(t.Items[r]).price))+" ")]):t._e(),e("div",[e("strong",{staticClass:"product-price"},[t._v(t._s(t._f("priceUnit")(t.getVariant(t.Items[r]).price_with_discount)))])])]),e("td",{attrs:{"data-title":"تعداد "}},[e("div",{staticClass:"qty-box d-flex ltr"},[e("numberCounter",{staticClass:"inline-flex",attrs:{min:1,max:t.getVariant(t.Items[r]).qty>0?t.getVariant(t.Items[r]).qty:1/0,number:s.qty},on:{input:function(e){return t.updateItemQuantity(e,r)}}})],1)]),e("td",{staticClass:"center",attrs:{"data-title":"وزن "}},[e("strong",[t._v(t._s(t.getVariant(t.Items[r]).title))])]),e("td",{staticClass:"center",attrs:{"data-title":"مجموع "}},[t.showBeforePrice(s)?e("div",{staticClass:"line-through mb-2"},[t._v(" "+t._s(t._f("priceUnit")(t.getVariant(t.Items[r]).price*t.Items[r].qty))+" ")]):t._e(),e("div",[e("strong",{staticClass:"product-price"},[t._v(t._s(t._f("priceUnit")(t.getVariant(t.Items[r]).price_with_discount*t.Items[r].qty)))])])])])})),0)])]),e("div",{staticClass:"coupen-code-wrapper rounded-8"},[e("h4",[t._v("آدرس")]),t.Addresses?e("label",[t._v("آدرس خود را انتخاب کنید")]):t._e(),e("ul",{staticClass:"nav nav-tabs tab-cards",attrs:{id:"submitProductTab",role:"tablist"}},t._l(t.Addresses,(function(s,r){return e("li",{key:r,staticClass:"nav-item"},[e("div",{staticClass:"nav-link",class:t.Find_style(r)+" flex items-center",attrs:{id:"basic-info-tab","data-toggle":"tab",href:"#basic-info",role:"tab","aria-controls":"basic-info","aria-selected":"true"},on:{click:function(e){return t.Check_Index(r)}}},[e("div",{staticClass:"flex-1"},[t._v(" "+t._s(t.Addresses[r].province)+" ، "+t._s(t.Addresses[r].city)+" ، "+t._s(t.Addresses[r].address.substring(0,20))+" "),t.Addresses[r].address.length>16?e("span",{staticClass:"sp"},[t._v(" ...")]):t._e()])])])})),0),e("div",{staticClass:"flex items-center justify-center"},[e("button",{staticClass:"btn-custom secondary",on:{click:function(e){t.addressModel=!0}}},[t._v("افزودن آدرس جدید")])])]),e("div",{staticClass:"coupen-code-wrapper rounded-8"},[e("h4",{staticStyle:{"font-size":"24px","margin-bottom":"0.3em"}},[t._v("گزینه های پرداختی")]),e("p",{staticClass:"custom-sub-title",staticStyle:{"margin-top":"10px"}},[t._v("برای استفاده از کیف پول گزینه ی آن را فعال کنید")]),e("hr"),e("div",{staticClass:"mb-4 row"},[e("span",{staticClass:"ml-2 rounded-8 justify-content-center flex align-items-center",staticStyle:{width:"46px",height:"46px",background:"#e5e5e563"}},[e("Icon",{staticStyle:{"font-size":"30px",color:"var(--primary-color)"},attrs:{icon:"ion:wallet-outline"}})],1),t._m(1),e("div",{staticClass:"row p-0 flex-1 justify-content-between"},[e("div",{staticClass:"col-6 flex flex-column justify-content-between p-0"},[e("div",{staticClass:"custom-sub-title",staticStyle:{"font-size":"1em"}},[t._v(" موجودی :")]),e("div",[e("span",{staticClass:"ml-2",staticStyle:{color:"var(--primary-color)"}},[t._v(t._s(t._f("price")(t.goldWalletPrice)))]),e("span",{staticStyle:{"font-size":".9rem",color:"#b1b1b1"}},[t._v("تومان")])])]),e("div",{staticClass:"flex align-items-center"},[e("vs-switch",{staticClass:"col-6",attrs:{color:"var(--primary-color)"},model:{value:t.use_wallet,callback:function(e){t.use_wallet=e},expression:"use_wallet"}})],1)])])])]),e("div",{staticClass:"col-xl-8 col-12"},[e("div",{staticClass:"coupen-code-wrapper rounded-8 font-size-1"},[e("div",{staticClass:"flex justify-content-between mb-3"},[e("div",{staticClass:"title"},[t._v("جمع کل مبلغ خرید")]),e("div",{staticClass:"value"},[t._v(t._s(t._f("priceUnit")(t.price)))])]),e("div",{staticClass:"flex justify-content-between mb-3"},[e("div",{staticClass:"title"},[t._v("تخفیف")]),e("div",{staticClass:"value"},[t._v(t._s(t._f("priceUnit")(t.totalDiscount)))])]),e("div",{staticClass:"flex justify-content-between mb-3"},[e("div",{staticClass:"title"},[t._v("کیف پول")]),e("div",{staticClass:"value"},[t._v(" "+t._s(t._f("priceUnit")(t.use_wallet?Math.min(t.goldWalletPrice,t.Total):0))+" ")])]),e("vs-divider"),e("div",{staticClass:"flex justify-content-between"},[e("div",{staticClass:"title"},[t._v("مبلغ قابل پرداخت")]),e("div",{staticClass:"value"},[t._v(t._s(t._f("priceUnit")(t.showPrice)))])])],1),e("button",{staticClass:"btn-custom secondary btn-block",on:{click:t.Submit_Order}},[t._v("ثبت سفارش")])])]),e("modal",{on:{close:t.clear},scopedSlots:t._u([{key:"header",fn:function(){return[t._v(" افزودن آدرس جدید ")]},proxy:!0},{key:"body",fn:function(){return[e("form",{on:{submit:function(e){return e.preventDefault(),t.beforeAdd_Address.apply(null,arguments)}}},[e("div",{staticClass:"row"},[e("div",{staticClass:"col-lg-4 form-group"},[e("label",[t._v("نام و نام خانوادگی دریافت کننده")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.Form_Data.reciver_fname,expression:"Form_Data.reciver_fname"},{name:"validate",rawName:"v-validate",value:{required:!0,fa:!0},expression:"{required: true, fa: true}"}],staticClass:"form-control",attrs:{type:"text",placeholder:"نام و نام خانوادگی دریافت کننده",name:"fullname"},domProps:{value:t.Form_Data.reciver_fname},on:{input:function(e){e.target.composing||t.$set(t.Form_Data,"reciver_fname",e.target.value)}}}),t._l(t.errors.collect("fullname"),(function(s){return e("div",{key:s,staticClass:"text-danger text-sm"},[t._v(t._s(s)+" ")])}))],2),e("div",{staticClass:"col-lg-4 form-group"},[e("label",[t._v("استان")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.Form_Data.province,expression:"Form_Data.province"},{name:"validate",rawName:"v-validate",value:{required:!0,fa:!0},expression:"{required: true, fa: true}"}],staticClass:"form-control",attrs:{type:"text",placeholder:"استان",name:"state"},domProps:{value:t.Form_Data.province},on:{input:function(e){e.target.composing||t.$set(t.Form_Data,"province",e.target.value)}}}),t._l(t.errors.collect("state"),(function(s){return e("div",{key:s,staticClass:"text-danger text-sm"},[t._v(t._s(s))])}))],2),e("div",{staticClass:"col-lg-4 form-group"},[e("label",[t._v("شهر")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.Form_Data.city,expression:"Form_Data.city"},{name:"validate",rawName:"v-validate",value:{required:!0,fa:!0},expression:"{required: true, fa: true}"}],staticClass:"form-control",attrs:{type:"text",placeholder:"شهر",name:"city"},domProps:{value:t.Form_Data.city},on:{input:function(e){e.target.composing||t.$set(t.Form_Data,"city",e.target.value)}}}),t._l(t.errors.collect("city"),(function(s){return e("div",{key:s,staticClass:"text-danger text-sm"},[t._v(t._s(s))])}))],2),e("div",{staticClass:"col-lg-4 form-group"},[e("label",[t._v("کد پستی")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.Form_Data.zipcode,expression:"Form_Data.zipcode"},{name:"validate",rawName:"v-validate",value:{required:!0,numeric:!0,min:10,max:10},expression:"{required: true, numeric: true,min:10,max:10}"}],staticClass:"form-control",attrs:{type:"Phone",placeholder:" xxxxxxxxxx ",name:"zip"},domProps:{value:t.Form_Data.zipcode},on:{keypress:t.onlyNumber,input:function(e){e.target.composing||t.$set(t.Form_Data,"zipcode",e.target.value)}}}),t._l(t.errors.collect("zip"),(function(s){return e("div",{key:s,staticClass:"text-danger text-sm"},[t._v(t._s(s))])}))],2),e("div",{staticClass:"col-lg-4 form-group"},[e("label",[t._v("شماره تلفن همراه")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.Form_Data.reciver_phone,expression:"Form_Data.reciver_phone"},{name:"validate",rawName:"v-validate",value:{required:!0,mobile:!0},expression:"{required: true, mobile: true}"}],staticClass:"form-control",attrs:{type:"text",placeholder:" 09xxxxxxxxx ",name:"mobile"},domProps:{value:t.Form_Data.reciver_phone},on:{keypress:t.onlyNumber,input:function(e){e.target.composing||t.$set(t.Form_Data,"reciver_phone",e.target.value)}}}),t._l(t.errors.collect("mobile"),(function(s){return e("div",{key:s,staticClass:"text-danger text-sm"},[t._v(t._s(s)+" ")])}))],2),e("div",{staticClass:"col-lg-4 form-group"},[e("label",[t._v(" تلفن ثابت")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.Form_Data.reciver_fixed_phone,expression:"Form_Data.reciver_fixed_phone"},{name:"validate",rawName:"v-validate",value:{required:!0,phone:!0},expression:"{required: true, phone: true}"}],staticClass:"form-control",attrs:{type:"text",placeholder:" 0x1xxxxxxx ",name:"phone"},domProps:{value:t.Form_Data.reciver_fixed_phone},on:{keypress:t.onlyNumber,input:function(e){e.target.composing||t.$set(t.Form_Data,"reciver_fixed_phone",e.target.value)}}}),t._l(t.errors.collect("phone"),(function(s){return e("div",{key:s,staticClass:"text-danger text-sm"},[t._v(t._s(s))])}))],2),e("div",{staticClass:"col-md-12 form-group"},[e("label",[t._v("آدرس")]),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.Form_Data.address,expression:"Form_Data.address"},{name:"validate",rawName:"v-validate",value:{required:!0},expression:"{required: true}"}],staticClass:"form-control",attrs:{placeholder:"آدرس کامل",rows:"4",name:"address"},domProps:{value:t.Form_Data.address},on:{input:function(e){e.target.composing||t.$set(t.Form_Data,"address",e.target.value)}}}),t._v(" "),t._l(t.errors.collect("address"),(function(s){return e("div",{key:s,staticClass:"text-danger text-sm"},[t._v(t._s(s)+" ")])}))],2)]),e("div",{staticClass:"flex items-center justify-center"},[e("button",{staticClass:"btn-custom secondary",on:{click:function(e){return e.preventDefault(),t.beforeAdd_Address.apply(null,arguments)}}},[t._v(" ثبت آدرس")])])])]},proxy:!0}],null,!1,1856114577),model:{value:t.addressModel,callback:function(e){t.addressModel=e},expression:"addressModel"}})],1):t._e(),!t.$store.state.cart.items||t.$store.state.cart.items&&t.$store.state.cart.items.length<1?e("h2",{staticClass:"text-center",staticStyle:{"margin-top":"50px"}},[t._v("هیچ محصولی در سبد خرید ندارید")]):t._e(),e("modal",{attrs:{maxWidth:"500px"},on:{close:function(e){return t.$router.push("/my-orders")}},scopedSlots:t._u([{key:"header",fn:function(){return[t._v(" سفارش با موفقیت ثبت شد ")]},proxy:!0},{key:"body",fn:function(){return[e("p",{staticStyle:{"text-align":"center","font-size":"17px"}},[t._v("لطفا منتظر تماس کارشناس فروش ما باشید")])]},proxy:!0}]),model:{value:t.endModel,callback:function(e){t.endModel=e},expression:"endModel"}})],1)},a=[function(){var t=this,e=t._self._c;return e("thead",{staticClass:"center"},[e("tr",[e("th",[t._v("حذف")]),e("th",[t._v("محصول")]),e("th",[t._v("قیمت واحد")]),e("th",[t._v("تعداد")]),e("th",[t._v("وزن")]),e("th",[t._v("مجموع")])])])},function(){var t=this,e=t._self._c;return e("div",{staticClass:"flex p-0"},[e("div",{staticClass:"ml-4 flex flex-column justify-content-between"},[e("div",[t._v(" کیف پول")]),e("span",{staticClass:"custom-sub-title"},[t._v("مانده نقدی در هر خرید قابل استفاده است")])])])}],i=s("be3b"),o=s("aff5"),l=function(){var t=this,e=t._self._c;return e("div",{staticClass:"qty-box d-flex num"},[e("span",{staticClass:"qty-subtract",attrs:{disabled:t.value<=t.min},on:{click:function(e){return t.checkValue(--t.value)}}},[e("i",{staticClass:"fa fa-minus"})]),e("input",{directives:[{name:"model",rawName:"v-model.number",value:t.value,expression:"value",modifiers:{number:!0}}],staticStyle:{"min-width":"18.2px"},style:"width :"+t.width,attrs:{type:"number",name:"qty"},domProps:{value:t.value},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.checkValue(t.value)},blur:[function(e){return t.checkValue(t.value)},function(e){return t.$forceUpdate()}],input:[function(e){e.target.composing||(t.value=t._n(e.target.value))},function(e){return t.$emit("input",t.value)}]}}),e("span",{staticClass:"qty-add",attrs:{disabled:t.value>=t.max},on:{click:function(e){return t.checkValue(++t.value)}}},[e("i",{staticClass:"fa fa-plus"})])])},n=[],c={name:"numberCounter",props:{min:Number,max:Number,number:Number},data(){return{value:0}},methods:{notif(t){let e="";e="min"===t?` حداقل تعداد مجاز${this.min}عدد است `:` حداکثر تعداد مجاز${this.max}عدد است `,this.$vs.notify({title:"خطا",text:e,color:"danger",iconPack:"feather",icon:"icon-alert-circle"})},checkValue(t){t>this.max?(this.value=this.max,setTimeout(()=>{this.notif("max")},100),this.$emit("input",this.max)):t<this.min?(this.value=this.min,setTimeout(()=>{this.notif("min")},100),this.$emit("input",this.min)):this.$emit("input",t)}},watch:{value(t){this.checkValue(t)}},computed:{width(){return 7*this.value.toString().length+31+"px"}},created(){this.value=this.number}},d=c,u=s("2877"),m=Object(u["a"])(d,l,n,!1,null,null,null),p=m.exports,v=s("5ea9"),_={props:{togglePreLoader:Function},components:{modal:o["a"],Icon:v["a"],numberCounter:p},data(){return{use_wallet:!1,wallet:{credit:null,gold_toman:null},use_credit:!1,Addresses:[],Address_Id:null,Form_Data:{reciver_fname:null,province:null,city:null,address:null,reciver_phone:null,reciver_fixed_phone:null,zipcode:null,new:null,is_default:1},Data:null,shippingAddress:void 0,addressModel:!1,endModel:!1}},methods:{async getWallet(){try{this.togglePreLoader("open");let{data:t}=await i["a"].get("/cu/customer/wallet");this.wallet=t}catch(t){if(t.response&&t.response.data.errors){let e="";for(let s of Object.values(t.response.data.errors))s.map(t=>{t.includes("shipping address")?e+=t.replace("shipping address","آدرس")+"<br/>":e+=t+"<br/>"});this.$vs.notify({title:"خطایی رخ داد",time:3500,text:e,color:"var(--secondary-color)",icon:"error_outline"})}else t&&("Error: Network Error"==t?this.$vs.notify({title:"خطایی رخ داد",time:3500,text:"اتصال برقرار نشد",color:"var(--secondary-color)",icon:"error_outline"}):this.$vs.notify({title:"خطایی رخ داد",time:3500,text:t,color:"var(--secondary-color)",icon:"error_outline"}))}finally{this.togglePreLoader("close")}},showBeforePrice(t){const e=this.getVariant(t);return e.price!==e.price_with_discount},getVariant(t){const e=t.product.variants.filter(e=>e.id===t.vid);if(e&&e.length)return e[0]},onlyNumber(t){let e=t.keyCode?t.keyCode:t.which;(e<48||e>57)&&t.preventDefault()},clear(){this.Form_Data={reciver_fname:null,province:null,city:null,address:null,reciver_phone:null,reciver_fixed_phone:null,zipcode:null,new:null,is_default:1}},updateItemQuantity(t,e){this.$store.dispatch("cart/updateItemQuantity",{quantity:t,index:e})},Remove(t){this.$store.dispatch("cart/remove",this.Items[t])},Check_Index(t){this.Address_Id=t,this.shippingAddress=this.Addresses[t]},Find_style(t){return t==this.Address_Id?"active":""},async Get_Addresses(){try{this.togglePreLoader("open");let{data:t}=await i["a"].get("/cu/address");this.Addresses=t,this.Address_Id=t.findIndex(t=>0!==t.is_default),this.shippingAddress=t.filter(t=>0!==t.is_default)[0]}catch(t){if(t.response&&t.response.data.errors){let e="";for(let s of Object.values(t.response.data.errors))s.map(t=>{t.includes("shipping address")?e+=t.replace("shipping address","آدرس")+"<br/>":e+=t+"<br/>"});this.$vs.notify({title:"خطایی رخ داد",time:3500,text:e,color:"var(--secondary-color)",icon:"error_outline"})}else t&&("Error: Network Error"==t?this.$vs.notify({title:"خطایی رخ داد",time:3500,text:"اتصال برقرار نشد",color:"var(--secondary-color)",icon:"error_outline"}):this.$vs.notify({title:"خطایی رخ داد",time:3500,text:t,color:"var(--secondary-color)",icon:"error_outline"}))}finally{this.togglePreLoader("close")}},async Submit_Order(){try{if(this.togglePreLoader("open"),!this.Addresses||!this.shippingAddress)throw"وارد کردن آدرس الزامی است";let t=[];for(let e of this.Items){let s={title:e.title,price:this.getVariant(e).price_with_discount*e.qty,qty:e.qty,product_id:e.pid,variant_id:e.vid,grams:this.getVariant(e).grams,rial_pay:this.getVariant(e).rial_pay,variant_title:this.getVariant(e).title,is_preorder:this.getVariant(e).is_pre_order,total_discount:e.qty*(this.getVariant(e).price-this.getVariant(e).price_with_discount),total_price:this.getVariant(e).price*e.qty,promotion_id:e.promotion_id};t.push(s)}await Object(i["a"])({method:"post",url:"/cu/order",headers:{},data:{app:"web",order_items:t,shipping_address:this.shippingAddress,total_price:this.Total,sts:1,total_discount:this.totalDiscount,price:this.price,total_weight:this.totalWeight,gold_price_original:parseInt(this.$store.state.config.price.geram18.p.split(",").join("")),use_wallet:this.use_wallet}}),this.endModel=!0,this.$store.dispatch("cart/clear")}catch(t){if(t.response&&t.response.data.errors){let e="";for(let s of Object.values(t.response.data.errors))s.map(t=>{t.includes("shipping address")?e+=t.replace("shipping address","آدرس")+"<br/>":e+=t+"<br/>"});this.$vs.notify({title:"خطایی رخ داد",time:3500,text:e,color:"var(--secondary-color)",icon:"error_outline"})}else t&&("Error: Network Error"==t?this.$vs.notify({title:"خطایی رخ داد",time:3500,text:"اتصال برقرار نشد",color:"var(--secondary-color)",icon:"error_outline"}):this.$vs.notify({title:"خطایی رخ داد",time:3500,text:t,color:"var(--secondary-color)",icon:"error_outline"}))}finally{this.togglePreLoader("close")}},beforeAdd_Address(){this.$validator.validateAll().then(t=>{t?this.Add_Address():this.$vs.notify({title:"خطا",text:"مقادیر ورودی نا معتبراست",color:"danger"})})},async Add_Address(){try{this.togglePreLoader("open");let{data:t}=await Object(i["a"])({method:"post",url:"/cu/address",headers:{},data:this.Form_Data});this.Data=t,this.addressModel=!1,this.Get_Addresses(),this.$vs.notify({time:3500,text:"اطلاعات با موفقیت ویرایش شد",color:"var(--secondary-color)",icon:"check"})}catch(t){if(t.response&&t.response.data.errors){let e="";for(let s of Object.values(t.response.data.errors))s.map(t=>{t.includes("shipping address")?e+=t.replace("shipping address","آدرس")+"<br/>":e+=t+"<br/>"});this.$vs.notify({title:"خطایی رخ داد",time:3500,text:e,color:"var(--secondary-color)",icon:"error_outline"})}else t&&("Error: Network Error"==t?this.$vs.notify({title:"خطایی رخ داد",time:3500,text:"اتصال برقرار نشد",color:"var(--secondary-color)",icon:"error_outline"}):this.$vs.notify({title:"خطایی رخ داد",time:3500,text:t,color:"var(--secondary-color)",icon:"error_outline"}))}finally{this.togglePreLoader("close")}}},computed:{showPrice(){return this.use_wallet?this.goldWalletPrice<this.Total?this.Total-this.goldWalletPrice:0:this.Total},goldWalletPrice(){return Math.floor(this.wallet.gold_toman+this.wallet.credit)||0},Items(){return this.$store.state.cart.items},Total(){let t=0;for(let e of this.Items)t+=this.getVariant(e).price*e.qty;return t},price(){let t=0;for(let e of this.Items)t+=this.getVariant(e).price_with_discount*e.qty;return t},totalWeight(){let t=0;for(let e of this.Items)t+=this.getVariant(e).grams;return t},totalDiscount(){let t=0;for(let e of this.Items)t+=this.getVariant(e).price-this.getVariant(e).price_with_discount;return t}},async beforeCreate(){await this.$store.dispatch("cart/init")},async created(){await this.getWallet();try{this.togglePreLoader("open"),await this.Get_Addresses()}catch(t){if(t.response&&t.response.data.errors){let e="";for(let s of Object.values(t.response.data.errors))s.map(t=>{t.includes("shipping address")?e+=t.replace("shipping address","آدرس")+"<br/>":e+=t+"<br/>"});this.$vs.notify({title:"خطایی رخ داد",time:3500,text:e,color:"var(--secondary-color)",icon:"error_outline"})}else t&&("Error: Network Error"==t?this.$vs.notify({title:"خطایی رخ داد",time:3500,text:"اتصال برقرار نشد",color:"var(--secondary-color)",icon:"error_outline"}):this.$vs.notify({title:"خطایی رخ داد",time:3500,text:t,color:"var(--secondary-color)",icon:"error_outline"}))}finally{this.togglePreLoader("close")}}},h=_,f=(s("5afc"),Object(u["a"])(h,r,a,!1,null,"47f66c5b",null));e["default"]=f.exports}}]); //# sourceMappingURL=chunk-6f674716.a119215c.js.map
Copyright ©2k19 -
Hexid
|
Tex7ure