Files
nademitex_user/dist/assets/ProductDetailView-5IPJ4kFG.js
T

1 line
17 KiB
JavaScript
Raw Normal View History

2026-10-29 15:26:08 +03:30
import{At as e,D as t,F as n,G as r,M as i,Nt as a,Pt as o,U as s,_ as c,c as l,d as u,f as d,g as f,i as p,k as m,l as h,nt as g,o as ee,t as _,u as v,ut as y,v as b}from"./_plugin-vue_export-helper-1xMDlcEE.js";import{l as x}from"./BasicIcon-DPmc0iaK.js";import{o as S}from"./format-C72AoJ2H.js";import{t as C}from"./catalog-DWpH1dVc.js";import{t as w}from"./cart-F5Rptvi1.js";import{t as T}from"./IconCart-D9TX5E-P.js";import{C as E,S as D,l as O,r as k}from"./index-DYwnTikp.js";import{t as te}from"./IconChevronBack-BsHmfODG.js";import{t as ne}from"./PageSkeleton-DYdjm4l9.js";import{a as re,o as ie,t as ae}from"./crm-CgnSby61.js";import{n as oe,r as se,t as ce}from"./IconWeave-DAcvD2P0.js";import{t as le}from"./useGoBack-DnRfwA4b.js";import{t as ue}from"./useTouchSwipe-C8fUyAcQ.js";import{t as de}from"./IconHeart-CvzbNH_T.js";import{n as fe,t as pe}from"./AddressCompletionModal-DV8NqYZ8.js";import{n as A,r as me,t as he}from"./productAvailability-B5nVr_sJ.js";var ge=[`width`,`height`],j=[`stroke`],M=[`stroke`],N=[`stroke`],_e=b({__name:`IconShare`,props:{size:{default:20},color:{default:`#9AA3AF`}},setup(e){return(t,n)=>(i(),d(`svg`,{width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`},[h(`path`,{d:`M12 3.5v11`,stroke:e.color,"stroke-width":`1.5`,"stroke-linecap":`round`},null,8,j),h(`path`,{d:`M8.25 7 12 3.25 15.75 7`,stroke:e.color,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,M),h(`path`,{d:`M6.5 11.5v7.25c0 .97.78 1.75 1.75 1.75h7.5c.97 0 1.75-.78 1.75-1.75V11.5`,stroke:e.color,"stroke-width":`1.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},null,8,N)],8,ge))}}),P={class:`dialog card product-order-modal`},F={class:`product-order-modal__head`},I={class:`product-order-modal__rows`},L={class:`product-order-row__color`},R=[`title`],z={key:0,class:`product-order-row__label`},B={class:`product-order-row__stepper`},V=[`disabled`,`onClick`],H={class:`product-order-row__qty`},U=[`disabled`,`onClick`],W={key:0,class:`product-order-modal__error`},G={class:`product-order-modal__footer`},K={class:`product-order-modal__prices`},q={key:0,class:`product-order-modal__price`},J={class:`product-order-modal__price`},Y={key:0},X={key:1},Z={key:2},Q={key:0,class:`product-order-modal__hint`},ve=_(b({__name:`ProductOrderModal`,props:{open:{type:Boolean},product:{},rollMeters:{},minRolls:{},basePrice:{},loading:{type:Boolean},error:{}},emits:[`close`,`submit`],setup(e,{emit:m}){let _=e,b=m,C=g([]);s(()=>[_.open,_.product?.colors.length],([e])=>{!e||!_.product||(C.value=_.product.colors.map(()=>0))});let w=l(()=>C.value.reduce((e,t)=>e+(t>0?t:0),0)),T=l(()=>w.value*_.rollMeters),E=l(()=>!_.basePrice||T.value<=0?null:_.basePrice*T.value);function D(e){e.key===`Escape`&&_.open&&b(`close`)}s(()=>_.open,e=>{document.body.style.overflow=e?`hidden`:``,e?window.addEventListener(`keydown`,D):window.removeEventListener(`keydown`,D)},{immediate:!0}),t(()=>{document.body.style.overflow=``,window.removeEventListener(`keydown`,D)});function O(e,t){let n=[...C.value];n[e]=Math.max(0,(n[e]??0)+t),C.value=n}function te(){b(`submit`,[...C.value])}return(t,s)=>(i(),v(ee,{to:`body`},[e.open&&e.product?(i(),d(`div`,{key:0,class:`dialog-overlay product-order-overlay`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`product-order-title`,onClick:s[1]||=x(e=>b(`close`),[`self`])},[h(`div`,P,[h(`header`,F,[s[2]||=h(`h3`,{id:`product-order-title`,class:`product-order-modal__title`},`ثبت سفارش`,-1),h(`button`,{type:`button`,class:`product-order-modal__close`,"aria-label":`بستن`,onClick:s[0]||=e=>b(`close`)},` × `)]),s[5]||=h(`div`,{class:`product-order-modal__table-head`,"aria-hidden":`true`},[h(`span`,null,`رنگ`),h(`span`,null,`طاقه`)],-1),h(`ul`,I,[(i(!0),d(p,null,n(e.product.colors,(t,n)=>(i(),d(`li`,{key:n,class:`product-order-row`},[h(`div`,L,[h(`span`,{class:`product-order-row__swatch`,style:a(y(A)(t,y(me)(e.product.colorImages,e.product.colorVariantImages,n))),title:t},null,12,R),t?(i(),d(`span`,z,o(t),1)):u(``,!0)]),h(`div`,B,[h(`butt