Files
nademitex_user/dist/assets/ProductDetailView-DbF7FeFN.js
T

1 line
20 KiB
JavaScript
Raw Normal View History

2026-09-24 22:29:24 +03:30
import{At as e,D as t,F as n,G as r,K as i,M as a,Nt as o,Pt as s,U as c,_ as l,c as u,d,f,g as p,h as m,i as h,k as g,l as _,nt as v,o as y,t as b,u as x,ut as S,v as C}from"./_plugin-vue_export-helper-1xMDlcEE.js";import{s as w,u as T}from"./BasicIcon-Bzeb0Iwd.js";import{o as E}from"./format-C72AoJ2H.js";import{t as D}from"./catalog-BHsy1JeE.js";import{A as O,M as k,O as A,c as j,j as ee,l as te,n as M}from"./index-3Kv0ngks.js";import{t as ne}from"./IconChevronBack-CDeN0Cbu.js";import{t as re}from"./PageSkeleton-DYdjm4l9.js";import{a as ie,o as ae,t as oe}from"./crm-DoYzOa8A.js";import{t as N}from"./catalogRequests-Bfg-Nm09.js";import{t as se}from"./useGoBack-pkrD1deE.js";import{t as ce}from"./IconShoppingBag-BHoZiOex.js";import{t as le}from"./quick-catalog-request-Di7-t6Ua.js";import{t as ue}from"./IconHeart-CvzbNH_T.js";import{n as P,t as de}from"./colorSwatch-BgOH1LE5.js";var F=[`width`,`height`],I=[`stroke`],L=[`stroke`],R=[`stroke`],fe=C({__name:`IconShare`,props:{size:{default:20},color:{default:`#9AA3AF`}},setup(e){return(t,n)=>(a(),f(`svg`,{width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":`true`},[_(`path`,{d:`M12 3.5v11`,stroke:e.color,"stroke-width":`1.5`,"stroke-linecap":`round`},null,8,I),_(`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,L),_(`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,R)],8,F))}}),z=[`width`,`height`,`stroke`],pe=C({__name:`IconRuler`,props:{size:{default:22},color:{default:`currentColor`}},setup(e){return(t,n)=>(a(),f(`svg`,{width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,stroke:e.color,"stroke-width":`1.6`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[...n[0]||=[m(`<rect x="3" y="8" width="18" height="8" rx="1.5"></rect><path d="M7 8v3"></path><path d="M10 8v4"></path><path d="M13 8v3"></path><path d="M16 8v4"></path>`,5)]],8,z))}}),B=[`width`,`height`,`stroke`],me=C({__name:`IconWeave`,props:{size:{default:22},color:{default:`currentColor`}},setup(e){return(t,n)=>(a(),f(`svg`,{width:e.size,height:e.size,viewBox:`0 0 24 24`,fill:`none`,stroke:e.color,"stroke-width":`1.6`,"stroke-linecap":`round`,"aria-hidden":`true`},[...n[0]||=[m(`<path d="M6 4v16"></path><path d="M10 4v16"></path><path d="M14 4v16"></path><path d="M18 4v16"></path><path d="M4 8h16"></path><path d="M4 12h16"></path><path d="M4 16h16"></path>`,7)]],8,B))}}),V=`درخواست دریافت فیزیکی کالیته برای شما ثبت شد و به زودی همکاران ما برای شما خواهند آورد`;function he(){let e=j(),t=N(),n=v(!1),r=v(``),i=v(!1),a=v(null),o=v(``);function s(){i.value=!1,a.value=null,o.value=``}async function c(e,n){let i=await t.create({items:[{productId:e.id,productName:e.name,productCode:e.code,quantity:1}],note:`آدرس: ${n}`});return i.success?(r.value=V,window.setTimeout(()=>{r.value=``},6e3),!0):(o.value=i.message,!1)}async function l(t){o.value=``;let r=e.user?.address?.trim();if(r){n.value=!0;try{await c(t,r)}finally{n.value=!1}return}a.value=t,i.value=!0}async function u(t){let r=t.trim();if(!r)return o.value=`آدرس الزامی است.`,!1;let i=a.value;if(!i)return!1;o.value=``,n.value=!0;try{if(!await e.updateProfile({address:r}))return o.value=`ذخیره آدرس ناموفق بود.`,!1;let t=await c(i,r);return t&&s(),t}finally{n.value=!1}}return{requesting:n,successMessage:r,addressModalOpen:i,addressError:o,requestCatalog:l,submitAddressAndRequest:u,closeAddressModal:s}}var H={class:`dialog card address-modal`},U={class:`address-modal__field`},ge={key:0,class:`address-modal__error`},_e={class:`dialog-actions address-modal__actions`},ve=b(C({__name:`AddressCompletionModal`,props:{open:{type:Boolean},loading:{type:Boolean},error:{}},emits:[`close`,`submit`],setup(e,{emit:n}){let o=e,u=n,m=v(``);c(()=>o.open,e=>{e&&(m.value=``)});function h(e){e.key=