PageSourceSearch

https://sechka.media/_nuxt/B8jgkbTL.js

js sechka.media collected 2026-10-08 15:13:32 UTC 5,800 bytes, 1 lines download raw bytes

1import{_ as I}from"./C3I_OZ1s.js";import{P as D}from"./CBWzhEei.js";import{p as x,_ as g,e as _,b as c,k as r,t as u,z as k,a8 as q,j as m,an as F,x as b,l as y,c as h,m as C,F as P,v as O,n as $,C as E,s as H,h as w,D as S,q as T}from"./DDPqEl69.js";import{O as B}from"./X1hS30AV.js";import{_ as N}from"./B_xmsby-.js";import{u as A}from"./rUBSKiH6.js";import"./B4kFveQE.js";import"./1NbP5WFt.js";import"./1C0AWg5t.js";import"./DP-hZGCS.js";import"./DiqhqKW9.js";const V=x("/images/icons/empty-history.svg"),j={class:"orders-history"},R={class:"orders-history-text"},z={__name:"OrdersHistoryEmpty",setup(o){return(a,e)=>(c(),_("div",j,[e[2]||(e[2]=r("div",{class:"orders-history-image"},[r("img",{src:V,alt:"empty-history"})],-1)),r("div",R,u(a.$t("pages.profile.ordersHistoryAwaitsToBeFulfilled")),1),r("button",{class:"orders-history-btn btn-primary",onClick:e[0]||(e[0]=t=>a.$emit("goToStore"))},[k(u(a.$t("pages.profile.goToCart"))+" ",1),e[1]||(e[1]=r("img",{src:q,alt:"right"},null,-1))])]))}},G=g(z,[["__scopeId","data-v-386a662b"]]),L={__name:"OrderStatus",props:{status:{type:String,required:!0}},setup(o){const a=o,e={Создан:{class:"order-status-create",translation:"forms.orderStatus.generated"},Оплачен:{class:"order-status-create",translation:"forms.orderStatus.paidFor"},"В обработке":{class:"order-status-in-processing",translation:"forms.orderStatus.inProcessing"},"В пути":{class:"order-status-in-transit",translation:"forms.orderStatus.onTheWay"},Завершен:{class:"order-status-completed",translation:"forms.orderStatus.completed"}},t=m(()=>{var s;return((s=e[a.status])==null?void 0:s.class)||""}),l=m(()=>{var i;const s=e[a.status];if(!s)return a.status;const{$t:n}=((i=F())==null?void 0:i.appContext.config.globalProperties)||{};return n?n(s.translation):a.status});return(s,n)=>(c(),_("span",{class:b([t.value,"order__status"])},u(l.value),3))}},U=g(L,[["__scopeId","data-v-35e34108"]]),W={class:"order__header"},J={class:"title-wrapper"},K={class:"title"},M={class:"date"},Q={__name:"OrderHeader",props:{order:{type:Object,required:!0},formattedDate:{type:String,required:!0}},setup(o){return(a,e)=>(c(),_("div",W,[r("div",J,[r("h3",K,u(a.$t("pages.profile.orderNumber"))+u(o.order.id),1),y(U,{status:o.order.status},null,8,["status"])]),r("div",M,u(o.formattedDate),1)]))}},X=g(Q,[["__scopeId","data-v-cb47dfbd"]]),Y=()=>{const o=t=>{if(!(t!=null&&t.providers))return 0;let l=0;return t.providers.forEach(s=>{s.products&&Array.isArray(s.products)&&s.products.forEach(n=>{const i=n.quantity||1;l+=n.buy_price*i})}),l},a=t=>{if(!(t!=null&&t.providers))return 0;let l=0;return t.providers.forEach(s=>{var n;(n=s.delivery_information)!=null&&n.sum&&(l+=s.delivery_information.sum)}),l};return{calculateTotalDiscount:o,calculateTotalDelivery:a,calculateOrderTotals:t=>({discount:o(t),delivery:a(t),total:t.final_price||0})}},Z={class:"order__footer"},tt={class:"order__footer_item"},et={class:"price"},st={class:"order__footer_item"},rt={class:"text"},ot={class:"price"},at={class:"order__footer_item full-cost"},nt={class:"text"},it={class:"price"},ct={__name:"OrderFooter",props:{order:{type:Object,required:!0}},setup(o){const{calculateTotalDiscount:a,calculateTotalDelivery:e}=Y(),t=o,l=m(()=>a(t.order)),s=m(()=>e(t.order));return(n,i)=>(c(),_("div",Z,[r("span",tt,[i[0]||(i[0]=r("span",{class:"text"},"Скидка",-1)),r("span",et,u((o.order.final_price-l.value-s.value).toFixed(2))+" ₽",1)]),r("span",st,[r("span",rt,u(n.$t("pages.cart.delivery")),1),r("span",ot,u(s.value)+" ₽",1)]),r("span",at,[r("span",nt,u(n.$t("pages.profile.total")),1),r("span",it,u(o.order.final_price||0)+" ₽",1)])]))}},lt=g(ct,[["__scopeId","data-v-c7e8ae1b"]]),dt={key:1,class:"main"},ut={class:"left"},_t={class:"orders"},pt={class:"order__items"},mt={__name:"OrdersHistory",props:{orders_history:{type:Array,required:!0,default:()=>[]},loadItems:{type:Boolean,default:!1},currentPage:{type:Number,default:0},getProducts:{type:Function,required:!0}},emits:["goToStore","changePage"],setup(o){const{formatDate:a}=A(),e=o,t=m(()=>e.orders_history.length===0),l=m(()=>[...e.orders_history].sort((i,p)=>p.code-i.code)),s=m(()=>l.value.slice(0,e.currentPage+10)),n=m(()=>e.orders_history.length>10||e.loadItems);return(i,p)=>(c(),_("div",{class:b({"orders-history-wrapper":t.value})},[t.value?(c(),h(G,{key:0,onGoToStore:p[0]||(p[0]=d=>i.$emit("goToStore"))})):(c(),_("div",dt,[r("div",ut,[r("div",_t,[(c(!0),_(P,null,O(s.value,d=>(c(),_("div",{key:d.id,class:"order"},[y(X,{order:d,"formatted-date":$(a)(d.date,"short")},null,8,["order","formatted-date"]),r("div",pt,[(c(!0),_(P,null,O(o.getProducts(d.providers),f=>(c(),h(B,{key:f.id,"in-orders-history":"",product:f},null,8,["product"]))),128))]),y(lt,{order:d},null,8,["order"])]))),128)),n.value?(c(),h(N,{key:0,"current-page":o.currentPage,"load-items":o.loadItems,"order-history-page":!0,total:o.orders_history.length,onChangeCurrentPage:p[1]||(p[1]=d=>i.$emit("changePage",d))},null,8,["current-page","load-items","total"])):C("",!0)])])]))],2))}},ft=g(mt,[["__scopeId","data-v-e67d9c09"]]),gt={class:"profile-wrapper"},yt={key:0,class:"title page-title"},ht={__name:"index",setup(o){const a=E(),{orders_history:e}=H(a),t=w(),l=S(!1),s=S(0);function n(){t.push("/store")}function i(d){let f=[];return d.forEach(v=>{f.push(...v.products)}),f}function p(){s.value=s.value+10}return(d,f)=>{const v=I;return c(),h(D,null,{default:T(()=>[r("div",gt,[y(v,null,{default:T(()=>[$(e).length>0?(c(),_("h1",yt,u(d.$t("pages.profile.ordersHistory")),1)):C("",!0),y(ft,{orders_history:$(e),loadItems:l.value,currentPage:s.value,getProducts:i,onGoToStore:n,onChangePage:p},null,8,["orders_history","loadItems","currentPage"])]),_:1})])]),_:1})}}},kt=g(ht,[["__scopeId","data-v-33f84bac"]]);export{kt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.