parity(api,apps): delivery-mode gaps — master OTP, non-blocking SMS, faToEn, v2 cart cap
D20: OTP_MASTER_CODE login bypass read only from the environment, disabled when unset, audited on every use, with a boot banner while armed. SMS no longer aborts the boot in production — it warns and declines silently, so no message can stop an operation. D19: port Utility::faTOen onto admin-entered mobiles (before the uniqueness lookup, which could previously be bypassed with Persian digits), and the create-only welcome SMS, byte-identical to the reference and fire-and-forget. user-app-v2 was missing the cart stock ceiling entirely: capQty/maxQty, the un-orderable guard and the qty clamp are ported, leaving v2's own design intact. The two cart stores are now byte-identical. isVariantOrderable and the orderable-first default selection ported too. jest 45/45; typecheck clean on api, admin-panel, user-app, user-app-v2. [ref: henza_server/app/Http/Controllers/Adm/AdminController.php:333,348,364,378-387] [ref: henza_server/app/Models/Utility.php:26] Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
2194b3d4d9
commit
460cf276b6
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{d as f,o as v,p as g,c as s,l as e,s as u,g as p,h as d,f as t,F as y,r as P,I as k,b as C,e as b,v as h,J as x,j as B,_ as V}from"./index-B3AQ-Dpo.js";import{P as w}from"./PageBar-Cvyz5ex2.js";import{a as I}from"./Spinner.vue_vue_type_style_index_0_lang-DKSb2qK3.js";import{S as N}from"./SectionHead-DRSKiTQc.js";import{P as F}from"./ProductCard-BHhIGh81.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-Cz9mrv7p.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BrkU_j90.js";import"./DialogVant.vue_vue_type_style_index_0_lang-CIIQfCa1.js";import"./cartStore-JeDfPEiX.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-DxJlISvB.js";import"./classCallCheck-Bg7rxoGt.js";const S={class:"coll"},j={key:0,class:"coll__grid"},q={key:1,class:"coll__empty"},z=f({__name:"CollectionView",setup(E){const l=x(),o=p(!1),n=p([]),m=d(()=>l.query.page||"مجموعه"),c=d(()=>n.value.filter(r=>r.collections.some(a=>a.collectionId===l.params.id)));return v(async()=>{o.value=!0;try{n.value=await g.listProducts()}finally{o.value=!1}}),(r,a)=>{const _=h("container");return t(),s("div",S,[e(w,{title:m.value,"back-to":"search"},null,8,["title"]),e(I,{spinning:o.value,tip:"درحال دریافت اطلاعات"},{default:u(()=>[e(_,{class:"coll__body"},{default:u(()=>[e(N,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),c.value.length?(t(),s("div",j,[(t(!0),s(y,null,P(c.value,i=>(t(),B(F,{key:i.id,value:i},null,8,["value"]))),128))])):o.value?b("",!0):(t(),s("section",q,[e(k,{icon:"vuesax-linear:box",size:"26"}),a[0]||(a[0]=C("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"])])}}}),U=V(z,[["__scopeId","data-v-6fdc1b6f"]]);export{U as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as f,o as v,c as s,l as e,q as u,g as m,h as p,f as o,F as g,r as y,I as P,b as k,e as C,s as b,H as h,j as x,_ as B}from"./index-CZjgV-Yn.js";import{P as V}from"./PageBar-Bkc2Ht1O.js";import{a as w}from"./Spinner.vue_vue_type_style_index_0_lang-ghXHCVpI.js";import{S as I}from"./SectionHead-CiwUIGKe.js";import{P as N}from"./ProductCard-Cd-G3dvx.js";import{a as q}from"./client-WIBW0tF5.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-DS8wIDwN.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-CY4DS_6T.js";import"./DialogVant.vue_vue_type_style_index_0_lang-DKsdrzNc.js";import"./cartStore-CoSoowuC.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-Ca8ka09f.js";import"./classCallCheck-BSDY9VEy.js";const F={class:"coll"},H={key:0,class:"coll__grid"},S={key:1,class:"coll__empty"},j=f({__name:"CollectionView",setup(z){const l=h(),t=m(!1),n=m([]),d=p(()=>l.query.page||"مجموعه"),r=p(()=>n.value.filter(c=>c.collections.some(a=>a.collectionId===l.params.id)));return v(async()=>{t.value=!0;try{n.value=await q.listProducts()}finally{t.value=!1}}),(c,a)=>{const _=b("container");return o(),s("div",F,[e(V,{title:d.value,"back-to":"search"},null,8,["title"]),e(w,{spinning:t.value,tip:"درحال دریافت اطلاعات"},{default:u(()=>[e(_,{class:"coll__body"},{default:u(()=>[e(I,{title:"محصولات این مجموعه",subtitle:"برای دیدن جزئیات، روی محصول ضربه بزنید"}),r.value.length?(o(),s("div",H,[(o(!0),s(g,null,y(r.value,i=>(o(),x(N,{key:i.id,value:i},null,8,["value"]))),128))])):t.value?C("",!0):(o(),s("section",S,[e(P,{icon:"vuesax-linear:box",size:"26"}),a[0]||(a[0]=k("p",null,"در این مجموعه محصولی ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"])])}}}),W=B(j,[["__scopeId","data-v-6fdc1b6f"]]);export{W as default};
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.dash[data-v-b8482634]{background:#fff;min-height:100vh}.dash__bar[data-v-b8482634]{position:fixed;top:0;left:0;right:0;z-index:20;background:#ffffffd1;-webkit-backdrop-filter:blur(18px) saturate(140%);backdrop-filter:blur(18px) saturate(140%);border-bottom:1px solid rgba(28,45,86,.05);box-shadow:0 8px 20px -18px #1c2d568c}.dash__barInner[data-v-b8482634]{max-width:768px;margin:0 auto;padding:10px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}.dash__brand[data-v-b8482634]{font-size:14.5px;font-weight:800;color:#14161a}.dash__exit[data-v-b8482634]{flex:0 0 auto;width:34px;height:34px;border:0;cursor:pointer;border-radius:11px;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4;transition:transform .18s ease}.dash__exit[data-v-b8482634]:active{transform:scale(.92)}.dash__body[data-v-b8482634]{padding-top:58px;padding-bottom:90px}.dash__reveal[data-v-b8482634]{opacity:0;transform:translate3d(0,14px,0) scale(.98);will-change:transform,opacity}.is-revealed .dash__reveal[data-v-b8482634]{opacity:1;transform:translateZ(0) scale(1);transition:opacity .62s cubic-bezier(.32,.72,0,1) var(--reveal-delay, 0ms),transform .62s cubic-bezier(.32,.72,0,1) var(--reveal-delay, 0ms)}@media (prefers-reduced-motion: reduce){.dash__reveal[data-v-b8482634]{opacity:1;transform:none}.is-revealed .dash__reveal[data-v-b8482634]{transition:none}}.dash__hero[data-v-b8482634]{margin-top:16px;margin-bottom:28px;padding:20px 18px 16px;border-radius:26px;background:linear-gradient(155deg,#14161a,#14161a 55%,#5e1427 130%);color:#fff;box-shadow:0 22px 40px -26px #14161a52}.dash__heroTop[data-v-b8482634]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.dash__heroIdentity[data-v-b8482634]{display:flex;flex-direction:column;gap:3px;min-width:0}.dash__heroName[data-v-b8482634]{font-size:13.5px;font-weight:800}.dash__heroMobile[data-v-b8482634]{font-size:11px;color:#ffffff8c;direction:ltr;text-align:right}.dash__heroSeal[data-v-b8482634]{flex:0 0 auto;padding:5px 12px;border-radius:999px;font-size:10.5px;font-weight:700}.dash__heroSeal.is-debtor[data-v-b8482634]{color:#fff;background:#a33c55}.dash__heroSeal.is-creditor[data-v-b8482634]{color:#14161a;background:#ffffffe6}.dash__heroFigure[data-v-b8482634]{margin-top:20px;display:flex;align-items:baseline;gap:8px}.dash__heroNum[data-v-b8482634]{font-size:34px;font-weight:800;letter-spacing:-.5px}.dash__heroUnit[data-v-b8482634]{font-size:12px;font-weight:600;color:#ffffff9e}.dash__heroDebt[data-v-b8482634]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:13px;border-top:1px solid rgba(255,255,255,.14);font-size:11.5px;color:#ffffff9e}.dash__heroDebt b[data-v-b8482634]{font-size:13px;font-weight:700;color:#fff}.dash__heroDebt i[data-v-b8482634]{font-style:normal;font-size:10.5px;font-weight:600;color:#ffffff9e;padding-inline-start:3px}.dash__invite[data-v-b8482634]{margin-top:16px;padding:26px 20px;border-radius:26px;background:#14161a;color:#fff;display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px}.dash__inviteIcon[data-v-b8482634]{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:#ffffff1a;margin-bottom:2px}.dash__invite h3[data-v-b8482634]{margin:0;font-size:14px;font-weight:800}.dash__invite p[data-v-b8482634]{margin:0;font-size:11.5px;color:#fff9;max-width:240px}.dash__inviteCta[data-v-b8482634]{margin-top:6px;padding:10px 22px;border:0;cursor:pointer;border-radius:999px;font-family:inherit;font-size:12px;font-weight:700;color:#14161a;background:#fff;transition:transform .18s ease}.dash__inviteCta[data-v-b8482634]:active{transform:scale(.96)}.dash__rows[data-v-b8482634]{margin-top:0;display:flex;flex-direction:column;gap:9px}.dash__row[data-v-b8482634]{display:flex;align-items:center;gap:12px;padding:13px 14px;border:1px solid #ECEDEF;border-radius:17px;cursor:pointer;background:#fff;font-family:inherit;text-align:right;transition:transform .18s ease,border-color .18s ease}.dash__row[data-v-b8482634]:active{transform:scale(.985);border-color:#7a1b3333}.dash__rowIcon[data-v-b8482634]{flex:0 0 auto;width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.dash__rowText[data-v-b8482634]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.dash__rowText b[data-v-b8482634]{font-size:12.5px;font-weight:700;color:#14161a}.dash__rowText small[data-v-b8482634]{font-size:10.5px;color:#8a909c}.dash__rate[data-v-b8482634]{margin-top:14px}
|
||||
@@ -0,0 +1 @@
|
||||
.dash[data-v-0633711e]{background:#fff;min-height:100vh}.dash__bar[data-v-0633711e]{position:fixed;top:0;left:0;right:0;z-index:20;background:#ffffffd1;-webkit-backdrop-filter:blur(18px) saturate(140%);backdrop-filter:blur(18px) saturate(140%);border-bottom:1px solid rgba(28,45,86,.05);box-shadow:0 8px 20px -18px #1c2d568c}.dash__barInner[data-v-0633711e]{max-width:768px;margin:0 auto;padding:10px 16px;display:flex;align-items:center;justify-content:space-between;gap:12px}.dash__brand[data-v-0633711e]{font-size:14.5px;font-weight:800;color:#14161a}.dash__exit[data-v-0633711e]{flex:0 0 auto;width:34px;height:34px;border:0;cursor:pointer;border-radius:11px;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4;transition:transform .18s ease}.dash__exit[data-v-0633711e]:active{transform:scale(.92)}.dash__body[data-v-0633711e]{padding-top:58px;padding-bottom:90px}.dash__reveal[data-v-0633711e]{opacity:0;transform:translate3d(0,14px,0) scale(.98);will-change:transform,opacity}.is-revealed .dash__reveal[data-v-0633711e]{opacity:1;transform:translateZ(0) scale(1);transition:opacity .62s cubic-bezier(.32,.72,0,1) var(--reveal-delay, 0ms),transform .62s cubic-bezier(.32,.72,0,1) var(--reveal-delay, 0ms)}@media (prefers-reduced-motion: reduce){.dash__reveal[data-v-0633711e]{opacity:1;transform:none}.is-revealed .dash__reveal[data-v-0633711e]{transition:none}}.dash__hero[data-v-0633711e]{margin-top:16px;margin-bottom:28px;padding:20px 18px 16px;border-radius:26px;background:linear-gradient(155deg,#14161a,#14161a 55%,#5e1427 130%);color:#fff;box-shadow:0 22px 40px -26px #14161a52}.dash__heroTop[data-v-0633711e]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.dash__heroIdentity[data-v-0633711e]{display:flex;flex-direction:column;gap:3px;min-width:0}.dash__heroName[data-v-0633711e]{font-size:13.5px;font-weight:800}.dash__heroMobile[data-v-0633711e]{font-size:11px;color:#ffffff8c;direction:ltr;text-align:right}.dash__heroSeal[data-v-0633711e]{flex:0 0 auto;padding:5px 12px;border-radius:999px;font-size:10.5px;font-weight:700}.dash__heroSeal.is-debtor[data-v-0633711e]{color:#fff;background:#a33c55}.dash__heroSeal.is-creditor[data-v-0633711e]{color:#14161a;background:#ffffffe6}.dash__heroFigure[data-v-0633711e]{margin-top:20px;display:flex;align-items:baseline;gap:8px}.dash__heroNum[data-v-0633711e]{font-size:34px;font-weight:800;letter-spacing:-.5px}.dash__heroUnit[data-v-0633711e]{font-size:12px;font-weight:600;color:#ffffff9e}.dash__heroDebt[data-v-0633711e]{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;padding-top:13px;border-top:1px solid rgba(255,255,255,.14);font-size:11.5px;color:#ffffff9e}.dash__heroDebt b[data-v-0633711e]{font-size:13px;font-weight:700;color:#fff}.dash__heroDebt i[data-v-0633711e]{font-style:normal;font-size:10.5px;font-weight:600;color:#ffffff9e;padding-inline-start:3px}.dash__invite[data-v-0633711e]{margin-top:16px;padding:26px 20px;border-radius:26px;background:#14161a;color:#fff;display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px}.dash__inviteIcon[data-v-0633711e]{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:#ffffff1a;margin-bottom:2px}.dash__invite h3[data-v-0633711e]{margin:0;font-size:14px;font-weight:800}.dash__invite p[data-v-0633711e]{margin:0;font-size:11.5px;color:#fff9;max-width:240px}.dash__inviteCta[data-v-0633711e]{margin-top:6px;padding:10px 22px;border:0;cursor:pointer;border-radius:999px;font-family:inherit;font-size:12px;font-weight:700;color:#14161a;background:#fff;transition:transform .18s ease}.dash__inviteCta[data-v-0633711e]:active{transform:scale(.96)}.dash__rows[data-v-0633711e]{margin-top:0;display:flex;flex-direction:column;gap:9px}.dash__row[data-v-0633711e]{display:flex;align-items:center;gap:12px;padding:13px 14px;border:1px solid #ECEDEF;border-radius:17px;cursor:pointer;background:#fff;font-family:inherit;text-align:right;transition:transform .18s ease,border-color .18s ease}.dash__row[data-v-0633711e]:active{transform:scale(.985);border-color:#7a1b3333}.dash__rowIcon[data-v-0633711e]{flex:0 0 auto;width:38px;height:38px;border-radius:12px;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.dash__rowText[data-v-0633711e]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.dash__rowText b[data-v-0633711e]{font-size:12.5px;font-weight:700;color:#14161a}.dash__rowText small[data-v-0633711e]{font-size:10.5px;color:#8a909c}.dash__rate[data-v-0633711e]{margin-top:14px}
|
||||
File diff suppressed because one or more lines are too long
+1
@@ -0,0 +1 @@
|
||||
import{d as l,j as n,s as c,u as _,ao as d,f as r,b as t,A as a,D as o,t as i}from"./index-B3AQ-Dpo.js";const m={class:"mDialog__body"},g={class:"mDialog__art"},D={class:"mDialog__title"},u={class:"mDialog__actions"},h=l({__name:"DialogVant",props:{timeOut:{},text1:{},text2:{},text3:{}},setup(s){return(e,x)=>(r(),n(_(d),{class:"mDialog"},{default:c(()=>[t("div",m,[t("div",g,[a(e.$slots,"img",{},()=>[o(i(s.text2),1)])]),t("div",D,[a(e.$slots,"title",{},()=>[o(i(s.text1),1)])]),t("div",u,[a(e.$slots,"button",{},()=>[o(i(s.text3),1)])])])]),_:3}))}});export{h as _};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{d as l,j as n,q as c,u as _,an as d,f as r,b as t,z as a,C as o,t as i}from"./index-CZjgV-Yn.js";const m={class:"mDialog__body"},g={class:"mDialog__art"},u={class:"mDialog__title"},D={class:"mDialog__actions"},h=l({__name:"DialogVant",props:{timeOut:{},text1:{},text2:{},text3:{}},setup(s){return(e,x)=>(r(),n(_(d),{class:"mDialog"},{default:c(()=>[t("div",m,[t("div",g,[a(e.$slots,"img",{},()=>[o(i(s.text2),1)])]),t("div",u,[a(e.$slots,"title",{},()=>[o(i(s.text1),1)])]),t("div",D,[a(e.$slots,"button",{},()=>[o(i(s.text3),1)])])])]),_:3}))}});export{h as _};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as f,o as g,c as o,l as e,q as c,g as m,f as t,F as p,b as i,r as y,I as b,u as h,e as k,v as P,h as C,s as F,j as x,_ as B}from"./index-CZjgV-Yn.js";import{P as V}from"./PageBar-Bkc2Ht1O.js";import{a as w}from"./Spinner.vue_vue_type_style_index_0_lang-ghXHCVpI.js";import{S}from"./SectionHead-CiwUIGKe.js";import{P as I}from"./ProductCard-Cd-G3dvx.js";import{a as N}from"./SingleProduct-DS8wIDwN.js";import{a as $}from"./client-WIBW0tF5.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./cartStore-CoSoowuC.js";import"./index-Ca8ka09f.js";import"./classCallCheck-BSDY9VEy.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-CY4DS_6T.js";import"./DialogVant.vue_vue_type_style_index_0_lang-DKsdrzNc.js";import"./dialogEmpty1-Caw7F5KL.js";const R={class:"favs"},j={class:"favs__grid"},q={key:1,class:"favs__empty"},z=f({__name:"FavoritesView",setup(E){const d=P(),v=N(),a=m(!1),l=m([]),r=C(()=>l.value.filter(u=>v.isFavorite(u.id)));return g(async()=>{a.value=!0;try{l.value=await $.listProducts()}finally{a.value=!1}}),(u,s)=>{const _=F("container");return t(),o("div",R,[e(V,{title:"علاقهمندی","back-to":"userPage::hasSubRoute"}),e(w,{spinning:a.value,tip:"در حال دریافت اطلاعات"},{default:c(()=>[e(_,{class:"favs__body"},{default:c(()=>[r.value.length?(t(),o(p,{key:0},[e(S,{title:"ذخیرهشدهها",subtitle:`${r.value.length} محصول`},null,8,["subtitle"]),i("div",j,[(t(!0),o(p,null,y(r.value,n=>(t(),x(I,{key:n.id,value:n},null,8,["value"]))),128))])],64)):a.value?k("",!0):(t(),o("section",q,[e(b,{icon:"vuesax-linear:heart",size:"26"}),s[1]||(s[1]=i("p",null,"هنوز محصولی را به علاقهمندیها اضافه نکردهاید.",-1)),i("button",{type:"button",class:"favs__emptyCta",onClick:s[0]||(s[0]=n=>h(d).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),Y=B(z,[["__scopeId","data-v-a8e72280"]]);export{Y as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as f,o as g,p as y,c as o,l as e,s as c,g as p,f as t,F as m,b as i,r as b,I as h,u as k,e as P,x as C,h as x,v as F,j as B,_ as V}from"./index-B3AQ-Dpo.js";import{P as w}from"./PageBar-Cvyz5ex2.js";import{a as S}from"./Spinner.vue_vue_type_style_index_0_lang-DKSb2qK3.js";import{S as I}from"./SectionHead-DRSKiTQc.js";import{P as N}from"./ProductCard-BHhIGh81.js";import{a as $}from"./SingleProduct-Cz9mrv7p.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./cartStore-JeDfPEiX.js";import"./index-DxJlISvB.js";import"./classCallCheck-Bg7rxoGt.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BrkU_j90.js";import"./DialogVant.vue_vue_type_style_index_0_lang-CIIQfCa1.js";import"./dialogEmpty1-Caw7F5KL.js";const R={class:"favs"},j={class:"favs__grid"},z={key:1,class:"favs__empty"},E=f({__name:"FavoritesView",setup(H){const d=C(),v=$(),a=p(!1),l=p([]),r=x(()=>l.value.filter(u=>v.isFavorite(u.id)));return g(async()=>{a.value=!0;try{l.value=await y.listProducts()}finally{a.value=!1}}),(u,s)=>{const _=F("container");return t(),o("div",R,[e(w,{title:"علاقهمندی","back-to":"userPage::hasSubRoute"}),e(S,{spinning:a.value,tip:"در حال دریافت اطلاعات"},{default:c(()=>[e(_,{class:"favs__body"},{default:c(()=>[r.value.length?(t(),o(m,{key:0},[e(I,{title:"ذخیرهشدهها",subtitle:`${r.value.length} محصول`},null,8,["subtitle"]),i("div",j,[(t(!0),o(m,null,b(r.value,n=>(t(),B(N,{key:n.id,value:n},null,8,["value"]))),128))])],64)):a.value?P("",!0):(t(),o("section",z,[e(h,{icon:"vuesax-linear:heart",size:"26"}),s[1]||(s[1]=i("p",null,"هنوز محصولی را به علاقهمندیها اضافه نکردهاید.",-1)),i("button",{type:"button",class:"favs__emptyCta",onClick:s[0]||(s[0]=n=>k(d).push({name:"home"}))}," دیدن محصولات ")]))]),_:1})]),_:1},8,["spinning"])])}}}),X=V(E,[["__scopeId","data-v-a8e72280"]]);export{X as default};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
.otp-single-input{display:flex;align-items:center}.auth[data-v-08d7f1af]{background:#fff;min-height:100vh}.auth__body[data-v-08d7f1af]{padding-top:86px;padding-bottom:90px}.auth__intro[data-v-08d7f1af]{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:24px}.auth__mark[data-v-08d7f1af]{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.auth__title[data-v-08d7f1af]{margin:14px 0 0;font-size:16px;font-weight:800;color:#14161a}.auth__sub[data-v-08d7f1af]{margin:6px 0 0;font-size:12.5px;color:#8a909c}.auth__card[data-v-08d7f1af]{padding:18px 16px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.auth__otp[data-v-08d7f1af]{display:flex;justify-content:center;gap:10px;direction:ltr;padding-bottom:6px}.auth__timer[data-v-08d7f1af]{margin:12px 0 16px;text-align:center;font-size:11.5px;color:#5b616e}.auth__form[data-v-08d7f1af] .ant-form-item-label>label{font-size:12px;color:#5b616e}.auth__cta[data-v-08d7f1af]{width:100%;padding:13px 18px;border:0;cursor:pointer;border-radius:14px;font-family:inherit;font-size:13px;font-weight:700;color:#fff;background:#14161a;transition:transform .15s ease,opacity .15s ease}.auth__cta[data-v-08d7f1af]:active{transform:scale(.99)}.auth__cta[data-v-08d7f1af]:disabled{opacity:.45;cursor:default}.auth__switch[data-v-08d7f1af]{margin:20px 0 0;text-align:center;font-size:12px;color:#5b616e}.auth__switch button[data-v-08d7f1af]{border:0;background:none;cursor:pointer;padding:0 3px;font-family:inherit;font-size:12px;font-weight:700;color:#7a1b33}.otp-input{width:48px;height:52px;padding:5px;margin:0;font-size:19px;font-weight:700;color:#14161a;background:#fff;border:1px solid #ECEDEF;border-radius:13px;text-align:center;transition:border-color .18s ease}.otp-input:focus{outline:none;border-color:#14161a}.otp-input.error{border-color:#e31a1a!important}.otp-input::-webkit-inner-spin-button,.otp-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.auth[data-v-23baea3e]{background:#fff;min-height:100vh}.auth__body[data-v-23baea3e]{padding-top:86px;padding-bottom:90px}.auth__intro[data-v-23baea3e]{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:24px}.auth__mark[data-v-23baea3e]{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.auth__title[data-v-23baea3e]{margin:14px 0 0;font-size:16px;font-weight:800;color:#14161a}.auth__sub[data-v-23baea3e]{margin:6px 0 0;font-size:12.5px;color:#8a909c}.auth__card[data-v-23baea3e]{padding:18px 16px 20px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.auth__form[data-v-23baea3e] .ant-form-item-label>label{font-size:12px;color:#5b616e}.auth__cta[data-v-23baea3e]{width:100%;margin-top:4px;padding:13px 18px;border:0;cursor:pointer;border-radius:14px;font-family:inherit;font-size:13px;font-weight:700;color:#fff;background:#14161a;transition:transform .15s ease}.auth__cta[data-v-23baea3e]:active{transform:scale(.99)}.auth__switch[data-v-23baea3e]{margin:20px 0 0;text-align:center;font-size:12px;color:#5b616e}.auth__switch button[data-v-23baea3e]{border:0;background:none;cursor:pointer;padding:0 3px;font-family:inherit;font-size:12px;font-weight:700;color:#7a1b33}
|
||||
.otp-single-input{display:flex;align-items:center}.auth[data-v-c130183b]{background:#fff;min-height:100vh}.auth__body[data-v-c130183b]{padding-top:86px;padding-bottom:90px}.auth__intro[data-v-c130183b]{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:24px}.auth__mark[data-v-c130183b]{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.auth__title[data-v-c130183b]{margin:14px 0 0;font-size:16px;font-weight:800;color:#14161a}.auth__sub[data-v-c130183b]{margin:6px 0 0;font-size:12.5px;color:#8a909c}.auth__card[data-v-c130183b]{padding:18px 16px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.auth__otp[data-v-c130183b]{display:flex;justify-content:center;gap:10px;direction:ltr;padding-bottom:6px}.auth__timer[data-v-c130183b]{margin:12px 0 16px;text-align:center;font-size:11.5px;color:#5b616e}.auth__form[data-v-c130183b] .ant-form-item-label>label{font-size:12px;color:#5b616e}.auth__cta[data-v-c130183b]{width:100%;padding:13px 18px;border:0;cursor:pointer;border-radius:14px;font-family:inherit;font-size:13px;font-weight:700;color:#fff;background:#14161a;transition:transform .15s ease,opacity .15s ease}.auth__cta[data-v-c130183b]:active{transform:scale(.99)}.auth__cta[data-v-c130183b]:disabled{opacity:.45;cursor:default}.auth__switch[data-v-c130183b]{margin:20px 0 0;text-align:center;font-size:12px;color:#5b616e}.auth__switch button[data-v-c130183b]{border:0;background:none;cursor:pointer;padding:0 3px;font-family:inherit;font-size:12px;font-weight:700;color:#7a1b33}.otp-input{width:48px;height:52px;padding:5px;margin:0;font-size:19px;font-weight:700;color:#14161a;background:#fff;border:1px solid #ECEDEF;border-radius:13px;text-align:center;transition:border-color .18s ease}.otp-input:focus{outline:none;border-color:#14161a}.otp-input.error{border-color:#e31a1a!important}.otp-input::-webkit-inner-spin-button,.otp-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.auth[data-v-23baea3e]{background:#fff;min-height:100vh}.auth__body[data-v-23baea3e]{padding-top:86px;padding-bottom:90px}.auth__intro[data-v-23baea3e]{display:flex;flex-direction:column;align-items:center;text-align:center;padding-bottom:24px}.auth__mark[data-v-23baea3e]{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.auth__title[data-v-23baea3e]{margin:14px 0 0;font-size:16px;font-weight:800;color:#14161a}.auth__sub[data-v-23baea3e]{margin:6px 0 0;font-size:12.5px;color:#8a909c}.auth__card[data-v-23baea3e]{padding:18px 16px 20px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.auth__form[data-v-23baea3e] .ant-form-item-label>label{font-size:12px;color:#5b616e}.auth__cta[data-v-23baea3e]{width:100%;margin-top:4px;padding:13px 18px;border:0;cursor:pointer;border-radius:14px;font-family:inherit;font-size:13px;font-weight:700;color:#fff;background:#14161a;transition:transform .15s ease}.auth__cta[data-v-23baea3e]:active{transform:scale(.99)}.auth__switch[data-v-23baea3e]{margin:20px 0 0;text-align:center;font-size:12px;color:#5b616e}.auth__switch button[data-v-23baea3e]{border:0;background:none;cursor:pointer;padding:0 3px;font-family:inherit;font-size:12px;font-weight:700;color:#7a1b33}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{d,f as o,c as i,l as a,u as c,y as P,z as S,n as b,A as k,j as v,e as y,g as u,p as B,B as C,C as E,s as p,F as L,r as I,I as N,b as V,h as $,v as A,_ as F}from"./index-B3AQ-Dpo.js";import{P as z}from"./PageBar-Cvyz5ex2.js";import{E as j,a as h}from"./Spinner.vue_vue_type_style_index_0_lang-DKSb2qK3.js";import{S as D}from"./SectionHead-DRSKiTQc.js";import{P as H}from"./ProductCard-BHhIGh81.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-Cz9mrv7p.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-BrkU_j90.js";import"./DialogVant.vue_vue_type_style_index_0_lang-CIIQfCa1.js";import"./cartStore-JeDfPEiX.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-DxJlISvB.js";import"./classCallCheck-Bg7rxoGt.js";const T={class:"flex justify-center items-center empty"},q=d({__name:"EmptyState",props:{description:{},image:{}},setup(e){return(t,s)=>(o(),i("div",T,[a(c(j),{description:"موردی یافت نشد",image:e.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),G="/assets/favoritEmpty-CIK7qR49.svg",K=d({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(e,{emit:t}){const s=t,n=P(),r=u(null);return S(r,()=>{s("fetch")},{distance:50}),(l,m)=>(o(),i("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:b({paddingTop:e.padding||c(n).headerHeight+"px"}),ref_key:"scrollArea",ref:r},[k(l.$slots,"default"),a(h,{cls:"my-[10px]",spinning:e.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),e.flag?(o(),v(q,{key:0,image:c(G)},null,8,["image"])):y("",!0)],4))}});function M(){const e=C({totalPages:0,productList:[],flag:!1});return{productsData:e,getProducts:async(s,n=!1)=>{if(!n){s.value=!0;try{e.productList=await B.listProducts(),e.flag=e.productList.length<1}catch(r){console.log(r)}finally{s.value=!1}}}}}const R={class:"newest"},Z={key:0,class:"newest__grid"},J={key:1,class:"newest__empty"},g=20,O=d({__name:"NewestView",setup(e){const{productsData:t,getProducts:s}=M(),n=u(!1),r=u(!1),l=u(g),m=$(()=>t.productList.slice(0,l.value));E(async()=>{await s(n,!1)});const w=async()=>{if(l.value<t.productList.length){l.value+=g;return}await s(r,!0)};return(Q,f)=>{const x=A("container");return o(),i("div",R,[a(z,{title:"جدیدترین محصولات","back-to":"home"}),a(h,{spinning:n.value,tip:"درحال دریافت اطلاعات"},{default:p(()=>[a(K,{class:"newest__scroll",loading:r.value,flag:c(t).flag,padding:"0px",onFetch:w},{default:p(()=>[a(x,{class:"newest__body"},{default:p(()=>[a(D,{title:"تازهها",subtitle:"آخرین افزودههای مجموعه"}),c(t).productList.length?(o(),i("div",Z,[(o(!0),i(L,null,I(m.value,_=>(o(),v(H,{key:_.id,value:_},null,8,["value"]))),128))])):n.value?y("",!0):(o(),i("section",J,[a(N,{icon:"vuesax-linear:box",size:"26"}),f[0]||(f[0]=V("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),ce=F(O,[["__scopeId","data-v-ecd416be"]]);export{ce as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{d,f as o,c as i,l as a,u as c,x as P,y as S,n as b,z as k,j as v,e as y,g as u,A as B,B as E,q as p,F as C,r as L,I,b as N,h as V,s as $,_ as A}from"./index-CZjgV-Yn.js";import{P as F}from"./PageBar-Bkc2Ht1O.js";import{E as z,a as h}from"./Spinner.vue_vue_type_style_index_0_lang-ghXHCVpI.js";import{S as j}from"./SectionHead-CiwUIGKe.js";import{P as q}from"./ProductCard-Cd-G3dvx.js";import{a as D}from"./client-WIBW0tF5.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./SingleProduct-DS8wIDwN.js";import"./NotifyVant.vue_vue_type_script_setup_true_lang-CY4DS_6T.js";import"./DialogVant.vue_vue_type_style_index_0_lang-DKsdrzNc.js";import"./cartStore-CoSoowuC.js";import"./dialogEmpty1-Caw7F5KL.js";import"./index-Ca8ka09f.js";import"./classCallCheck-BSDY9VEy.js";const H={class:"flex justify-center items-center empty"},T=d({__name:"EmptyState",props:{description:{},image:{}},setup(e){return(t,s)=>(o(),i("div",H,[a(c(z),{description:"موردی یافت نشد",image:e.image,class:"h-[200px] w-[200px] opacity-70"},null,8,["image"])]))}}),G="/assets/favoritEmpty-CIK7qR49.svg",K=d({__name:"ScrollFetchSearch",props:{loading:{type:Boolean},flag:{type:Boolean},padding:{}},emits:["fetch"],setup(e,{emit:t}){const s=t,n=P(),r=u(null);return S(r,()=>{s("fetch")},{distance:50}),(l,m)=>(o(),i("main",{class:"flex flex-col flex-1 overflow-auto no-scrollbar w-[100vw] max-w-screen-md m-auto",style:b({paddingTop:e.padding||c(n).headerHeight+"px"}),ref_key:"scrollArea",ref:r},[k(l.$slots,"default"),a(h,{cls:"my-[10px]",spinning:e.loading,indicator:!0,tip:"درحال دریافت اطلاعات"},null,8,["spinning"]),e.flag?(o(),v(T,{key:0,image:c(G)},null,8,["image"])):y("",!0)],4))}});function M(){const e=B({totalPages:0,productList:[],flag:!1});return{productsData:e,getProducts:async(s,n=!1)=>{if(!n){s.value=!0;try{e.productList=await D.listProducts(),e.flag=e.productList.length<1}catch(r){console.log(r)}finally{s.value=!1}}}}}const R={class:"newest"},Z={key:0,class:"newest__grid"},J={key:1,class:"newest__empty"},g=20,O=d({__name:"NewestView",setup(e){const{productsData:t,getProducts:s}=M(),n=u(!1),r=u(!1),l=u(g),m=V(()=>t.productList.slice(0,l.value));E(async()=>{await s(n,!1)});const w=async()=>{if(l.value<t.productList.length){l.value+=g;return}await s(r,!0)};return(Q,f)=>{const x=$("container");return o(),i("div",R,[a(F,{title:"جدیدترین محصولات","back-to":"home"}),a(h,{spinning:n.value,tip:"درحال دریافت اطلاعات"},{default:p(()=>[a(K,{class:"newest__scroll",loading:r.value,flag:c(t).flag,padding:"0px",onFetch:w},{default:p(()=>[a(x,{class:"newest__body"},{default:p(()=>[a(j,{title:"تازهها",subtitle:"آخرین افزودههای مجموعه"}),c(t).productList.length?(o(),i("div",Z,[(o(!0),i(C,null,L(m.value,_=>(o(),v(q,{key:_.id,value:_},null,8,["value"]))),128))])):n.value?y("",!0):(o(),i("section",J,[a(I,{icon:"vuesax-linear:box",size:"26"}),f[0]||(f[0]=N("p",null,"هنوز محصولی در مجموعه ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["loading","flag"])]),_:1},8,["spinning"])])}}}),ue=A(O,[["__scopeId","data-v-ecd416be"]]);export{ue as default};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as a,c as n,l as o,q as i,s as c,f as _,b as e,I as r,_ as f}from"./index-CZjgV-Yn.js";import{P as l}from"./PageBar-Bkc2Ht1O.js";const p={class:"notif"},d={class:"notif__empty"},m=a({__name:"NotificationsView",setup(u){return(x,t)=>{const s=c("container");return _(),n("div",p,[o(l,{title:"اعلانها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",d,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),N=f(m,[["__scopeId","data-v-44d0c9a5"]]);export{N as default};
|
||||
import{d as a,c as n,l as o,s as i,v as c,f as _,b as e,I as r,_ as f}from"./index-B3AQ-Dpo.js";import{P as l}from"./PageBar-Cvyz5ex2.js";const p={class:"notif"},d={class:"notif__empty"},m=a({__name:"NotificationsView",setup(u){return(v,t)=>{const s=c("container");return _(),n("div",p,[o(l,{title:"اعلانها","back-to":"home"}),o(s,{class:"notif__body"},{default:i(()=>[e("section",d,[o(r,{icon:"vuesax-linear:notification",size:"26"}),t[0]||(t[0]=e("p",null,"اعلانی برای نمایش وجود ندارد.",-1))])]),_:1})])}}}),N=f(m,[["__scopeId","data-v-44d0c9a5"]]);export{N as default};
|
||||
+1
@@ -0,0 +1 @@
|
||||
import{d as r,l as n,ah as p,ai as f,aj as h,ak as w,al as y,am as x,a6 as g,an as i,a5 as k,ad as N,G as S,f as V,c as v,u as P,n as _,s as b,b as l,I as B,A as I,D as z,t as C,e as O,g as D}from"./index-B3AQ-Dpo.js";const[T,U]=k("notify"),j=["lockScroll","position","show","teleport","zIndex"],A=w({},y,{type:i("danger"),color:String,message:g,position:i("top"),className:x,background:String,lockScroll:Boolean});var E=r({name:T,props:A,emits:["update:show"],setup(e,{emit:o,slots:t}){const a=s=>o("update:show",s);return()=>n(h,p({class:[U([e.type]),e.className],style:{color:e.color,background:e.background},overlay:!1,duration:.2,"onUpdate:show":a},f(e,j)),{default:()=>[t.default?t.default():e.message]})}});const G=N(E),$={key:0,class:"flex"},q={class:"w-full text-white my-2"},F={class:"w-full flex content-end"},J=r({__name:"NotifyVant",props:{modelValue:{type:Boolean},timeOut:{},text:{},color:{}},emits:["update:modelValue"],setup(e,{emit:o}){const t=D(!0),a=e,s=o;S(()=>a.modelValue,()=>{a.timeOut!==-1&&u()});const u=()=>{setTimeout(()=>{s("update:modelValue",!1)},a.timeOut)};return(d,c)=>e.modelValue?(V(),v("div",$,[n(P(G),{show:t.value,"onUpdate:show":c[0]||(c[0]=m=>t.value=m),style:_(e.color)},{default:b(()=>[l("div",q,[l("div",F,[n(B,{icon:"vuesax-linear:info-circle",class:"ml-[20px] text-white",size:"25"}),l("div",null,[I(d.$slots,"default",{},()=>[z(C(e.text),1)])])])])]),_:3},8,["show","style"])])):O("",!0)}});export{J as _};
|
||||
-1
@@ -1 +0,0 @@
|
||||
import{d as r,l as n,ag as p,ah as f,ai as h,aj as w,ak as y,al as g,a5 as x,am as i,a4 as k,ac as N,E as S,f as V,c as v,u as P,n as _,q as b,b as l,I as B,z as I,C as z,t as C,e as O,g as E}from"./index-CZjgV-Yn.js";const[T,U]=k("notify"),j=["lockScroll","position","show","teleport","zIndex"],q=w({},y,{type:i("danger"),color:String,message:x,position:i("top"),className:g,background:String,lockScroll:Boolean});var D=r({name:T,props:q,emits:["update:show"],setup(e,{emit:o,slots:t}){const a=s=>o("update:show",s);return()=>n(h,p({class:[U([e.type]),e.className],style:{color:e.color,background:e.background},overlay:!1,duration:.2,"onUpdate:show":a},f(e,j)),{default:()=>[t.default?t.default():e.message]})}});const $=N(D),A={key:0,class:"flex"},F={class:"w-full text-white my-2"},G={class:"w-full flex content-end"},J=r({__name:"NotifyVant",props:{modelValue:{type:Boolean},timeOut:{},text:{},color:{}},emits:["update:modelValue"],setup(e,{emit:o}){const t=E(!0),a=e,s=o;S(()=>a.modelValue,()=>{a.timeOut!==-1&&u()});const u=()=>{setTimeout(()=>{s("update:modelValue",!1)},a.timeOut)};return(d,c)=>e.modelValue?(V(),v("div",A,[n(P($),{show:t.value,"onUpdate:show":c[0]||(c[0]=m=>t.value=m),style:_(e.color)},{default:b(()=>[l("div",F,[l("div",G,[n(B,{icon:"vuesax-linear:info-circle",class:"ml-[20px] text-white",size:"25"}),l("div",null,[I(d.$slots,"default",{},()=>[z(C(e.text),1)])])])])]),_:3},8,["show","style"])])):O("",!0)}});export{J as _};
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -1 +1 @@
|
||||
import{d as _,c as s,b as a,l as d,I as b,t as u,z as i,f as t,v as p,_ as k}from"./index-CZjgV-Yn.js";const h={class:"bar"},f={class:"bar__inner"},m={key:1,class:"bar__spacer","aria-hidden":"true"},B={class:"bar__title"},g={class:"bar__trailing"},v=_({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{}},setup(e){const o=e,r=p();function l(){o.backTo?r.push({name:o.backTo}):r.back()}return(n,c)=>(t(),s("header",h,[a("div",f,[e.back?(t(),s("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:l},[d(b,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(t(),s("span",m)),a("h1",B,u(e.title),1),a("div",g,[i(n.$slots,"trailing",{},()=>[c[0]||(c[0]=a("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(n.$slots,"below",{},void 0,!0)]))}}),I=k(v,[["__scopeId","data-v-d2d3dfeb"]]);export{I as P};
|
||||
import{d as _,c as s,b as a,l as d,I as b,t as u,A as i,f as t,x as p,_ as k}from"./index-B3AQ-Dpo.js";const h={class:"bar"},f={class:"bar__inner"},m={key:1,class:"bar__spacer","aria-hidden":"true"},B={class:"bar__title"},g={class:"bar__trailing"},v=_({__name:"PageBar",props:{title:{},back:{type:Boolean,default:!0},backTo:{}},setup(e){const o=e,r=p();function l(){o.backTo?r.push({name:o.backTo}):r.back()}return(n,c)=>(t(),s("header",h,[a("div",f,[e.back?(t(),s("button",{key:0,type:"button",class:"bar__btn","aria-label":"بازگشت",onClick:l},[d(b,{icon:"vuesax-linear:arrow-right-1",size:"20"})])):(t(),s("span",m)),a("h1",B,u(e.title),1),a("div",g,[i(n.$slots,"trailing",{},()=>[c[0]||(c[0]=a("span",{class:"bar__spacer","aria-hidden":"true"},null,-1))],!0)])]),i(n.$slots,"below",{},void 0,!0)]))}}),x=k(v,[["__scopeId","data-v-d2d3dfeb"]]);export{x as P};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as F,k as D,f as t,c as a,F as P,b as o,u as e,w as S,l as p,I as h,X as z,i as N,e as c,t as _,C as V,q as I,j as q,g as E,_ as O}from"./index-CZjgV-Yn.js";import{a as U,S as $}from"./SingleProduct-DS8wIDwN.js";import{u as j}from"./cartStore-CoSoowuC.js";import{D as L}from"./index-Ca8ka09f.js";const M={class:"pc__art"},T=["alt"],X={key:1,class:"pc__artEmpty","aria-hidden":"true"},A=["aria-label"],G={key:2,class:"pc__flag"},H={key:3,class:"pc__flag pc__flag--soft"},J={class:"pc__title"},K={class:"pc__weight"},Q={key:0,class:"pc__meta"},R={key:0,class:"pc__wageOld"},W={class:"pc__wage"},Y=F({__name:"ProductCard",props:{value:{},wageBefore:{}},setup(d){const w=d,r=U(),{image:v,id:i,title:f,min_gram:y,wage:m,is_exist:k,qty:b,isPreOrder:x}=j(w.value),l=E(!1);function C(){l.value=!0}function g(n){return n%1===0?String(n):n.toFixed(2)}return(n,s)=>{const B=D("lazy");return t(),a(P,null,[o("article",{class:"pc",onClick:C},[o("div",M,[e(v)?S((t(),a("img",{key:0,alt:e(f)},null,8,T)),[[B,e(v)]]):(t(),a("div",X,[p(h,{icon:"vuesax-linear:diamonds",size:"26"})])),o("button",{type:"button",class:N(["pc__fav",{"is-on":e(r).isFavorite(e(i))}]),"aria-label":e(r).isFavorite(e(i))?"حذف از علاقهمندی":"افزودن به علاقهمندی",onClick:s[0]||(s[0]=z(u=>e(r).toggle(e(i)),["stop"]))},[p(h,{icon:e(r).isFavorite(e(i))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,A),e(k)?e(x)&&e(b)===0?(t(),a("span",H,"پیشسفارش")):c("",!0):(t(),a("span",G,"ناموجود"))]),o("h3",J,_(e(f)),1),o("p",K,[V(_(e(y))+" ",1),s[3]||(s[3]=o("span",{class:"pc__weightUnit"},"گرم",-1))]),e(m)!=null?(t(),a("div",Q,[d.wageBefore!=null?(t(),a("span",R,"اجرت "+_(g(d.wageBefore))+"٪",1)):c("",!0),o("span",W,_(g(e(m)))+"٪ اجرت",1)])):c("",!0)]),p(e(L),{visible:l.value,"onUpdate:visible":s[2]||(s[2]=u=>l.value=u),placement:"bottom",closable:!1,class:"rtl",height:"100vh",bodyStyle:{padding:0,position:"relative"}},{default:I(()=>[l.value?(t(),q($,{id:e(i),key:e(i),onCloseDrawer:s[1]||(s[1]=u=>l.value=!1)},null,8,["id"])):c("",!0)]),_:1},8,["visible"])],64)}}}),ae=O(Y,[["__scopeId","data-v-ed785ed2"]]);export{ae as P};
|
||||
import{d as D,k as F,f as t,c as a,F as P,b as o,u as e,w as S,l as p,I as h,Y as z,i as N,e as c,t as _,D as V,s as I,j as E,g as O,_ as U}from"./index-B3AQ-Dpo.js";import{a as $,S as j}from"./SingleProduct-Cz9mrv7p.js";import{u as q}from"./cartStore-JeDfPEiX.js";import{D as L}from"./index-DxJlISvB.js";const M={class:"pc__art"},T=["alt"],Y={key:1,class:"pc__artEmpty","aria-hidden":"true"},A=["aria-label"],G={key:2,class:"pc__flag"},H={key:3,class:"pc__flag pc__flag--soft"},J={class:"pc__title"},K={class:"pc__weight"},Q={key:0,class:"pc__meta"},R={key:0,class:"pc__wageOld"},W={class:"pc__wage"},X=D({__name:"ProductCard",props:{value:{},wageBefore:{}},setup(d){const w=d,r=$(),{image:v,id:i,title:f,min_gram:y,wage:m,is_exist:k,qty:b,isPreOrder:x}=q(w.value),l=O(!1);function C(){l.value=!0}function g(n){return n%1===0?String(n):n.toFixed(2)}return(n,s)=>{const B=F("lazy");return t(),a(P,null,[o("article",{class:"pc",onClick:C},[o("div",M,[e(v)?S((t(),a("img",{key:0,alt:e(f)},null,8,T)),[[B,e(v)]]):(t(),a("div",Y,[p(h,{icon:"vuesax-linear:diamonds",size:"26"})])),o("button",{type:"button",class:N(["pc__fav",{"is-on":e(r).isFavorite(e(i))}]),"aria-label":e(r).isFavorite(e(i))?"حذف از علاقهمندی":"افزودن به علاقهمندی",onClick:s[0]||(s[0]=z(u=>e(r).toggle(e(i)),["stop"]))},[p(h,{icon:e(r).isFavorite(e(i))?"vuesax-linear:heart-fill":"vuesax-linear:heart",size:"16"},null,8,["icon"])],10,A),e(k)?e(x)&&e(b)===0?(t(),a("span",H,"پیشسفارش")):c("",!0):(t(),a("span",G,"ناموجود"))]),o("h3",J,_(e(f)),1),o("p",K,[V(_(e(y))+" ",1),s[3]||(s[3]=o("span",{class:"pc__weightUnit"},"گرم",-1))]),e(m)!=null?(t(),a("div",Q,[d.wageBefore!=null?(t(),a("span",R,"اجرت "+_(g(d.wageBefore))+"٪",1)):c("",!0),o("span",W,_(g(e(m)))+"٪ اجرت",1)])):c("",!0)]),p(e(L),{visible:l.value,"onUpdate:visible":s[2]||(s[2]=u=>l.value=u),placement:"bottom",closable:!1,class:"rtl",height:"100vh",bodyStyle:{padding:0,position:"relative"}},{default:I(()=>[l.value?(t(),E(j,{id:e(i),key:e(i),onCloseDrawer:s[1]||(s[1]=u=>l.value=!1)},null,8,["id"])):c("",!0)]),_:1},8,["visible"])],64)}}}),ae=U(X,[["__scopeId","data-v-ed785ed2"]]);export{ae as P};
|
||||
@@ -1 +0,0 @@
|
||||
import{d as I,D as S,o as E,c as a,l,q as y,g as p,s as V,f as i,b as e,I as f,t,e as _,i as b,h as k,_ as h}from"./index-CZjgV-Yn.js";import{P as C}from"./PageBar-Bkc2Ht1O.js";import{S as N}from"./SectionHead-CiwUIGKe.js";import{a as T}from"./client-WIBW0tF5.js";const g={class:"prof"},B={class:"prof__identity"},D={class:"prof__avatar","aria-hidden":"true"},P={class:"prof__name"},x={key:0,class:"prof__mobile"},R={key:0,class:"prof__block"},w={class:"prof__specs"},F={class:"prof__spec"},z={class:"prof__spec"},M={class:"prof__spec"},O={class:"prof__spec"},U={key:1,class:"prof__empty"},A=I({__name:"ProfileView",setup(L){const c={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده"},u=S(),s=p(null),n=p(!1),v=k(()=>{var r;return((r=s.value)==null?void 0:r.verificationStep)==="VERIFIED"});return E(async()=>{if(u.customerId){n.value=!0;try{s.value=await T.getCustomer(u.customerId)}finally{n.value=!1}}}),(r,o)=>{const m=V("container");return i(),a("div",g,[l(C,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),l(m,{class:"prof__body"},{default:y(()=>{var d;return[e("section",B,[e("div",D,[l(f,{icon:"vuesax-linear:user",size:"30"})]),e("h2",P,t(((d=s.value)==null?void 0:d.fullName)??"—"),1),s.value?(i(),a("p",x,t(s.value.mobile),1)):_("",!0),s.value?(i(),a("span",{key:1,class:b(["prof__seal",v.value?"is-ok":"is-pending"])},t(c[s.value.verificationStep]??s.value.verificationStep),3)):_("",!0)]),s.value?(i(),a("section",R,[l(N,{title:"مشخصات",subtitle:"اطلاعات ثبتشده حساب شما"}),e("dl",w,[e("div",F,[o[0]||(o[0]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,t(s.value.fullName),1)]),e("div",z,[o[1]||(o[1]=e("dt",null,"تلفن همراه",-1)),e("dd",null,t(s.value.mobile),1)]),e("div",M,[o[2]||(o[2]=e("dt",null,"کد ملی",-1)),e("dd",null,t(s.value.nationalCode),1)]),e("div",O,[o[3]||(o[3]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,t(c[s.value.verificationStep]??s.value.verificationStep),1)])])])):n.value?_("",!0):(i(),a("section",U,[l(f,{icon:"vuesax-linear:user",size:"26"}),o[4]||(o[4]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))]))]}),_:1})])}}}),G=h(A,[["__scopeId","data-v-7c544fc5"]]);export{G as default};
|
||||
@@ -0,0 +1 @@
|
||||
import{d as S,E,o as I,p as y,c as a,l,s as b,g as c,v as V,f as i,b as e,I as p,t,e as _,i as g,h as k,_ as h}from"./index-B3AQ-Dpo.js";import{P as N}from"./PageBar-Cvyz5ex2.js";import{S as T}from"./SectionHead-DRSKiTQc.js";const B={class:"prof"},C={class:"prof__identity"},P={class:"prof__avatar","aria-hidden":"true"},x={class:"prof__name"},D={key:0,class:"prof__mobile"},R={key:0,class:"prof__block"},w={class:"prof__specs"},F={class:"prof__spec"},M={class:"prof__spec"},z={class:"prof__spec"},L={class:"prof__spec"},O={key:1,class:"prof__empty"},U=S({__name:"ProfileView",setup(A){const d={UNVERIFIED:"احراز نشده",STEP_ONE_SUBMITTED:"مرحله اول ثبت شده",STEP_TWO_SUBMITTED:"مرحله دوم ثبت شده",VERIFIED:"تایید شده"},f=E(),s=c(null),n=c(!1),v=k(()=>{var r;return((r=s.value)==null?void 0:r.verificationStep)==="VERIFIED"});return I(async()=>{if(f.isLoggedIn){n.value=!0;try{s.value=await y.getMe()}finally{n.value=!1}}}),(r,o)=>{const m=V("container");return i(),a("div",B,[l(N,{title:"اطلاعات کاربری","back-to":"userPage::hasSubRoute"}),l(m,{class:"prof__body"},{default:b(()=>{var u;return[e("section",C,[e("div",P,[l(p,{icon:"vuesax-linear:user",size:"30"})]),e("h2",x,t(((u=s.value)==null?void 0:u.fullName)??"—"),1),s.value?(i(),a("p",D,t(s.value.mobile),1)):_("",!0),s.value?(i(),a("span",{key:1,class:g(["prof__seal",v.value?"is-ok":"is-pending"])},t(d[s.value.verificationStep]??s.value.verificationStep),3)):_("",!0)]),s.value?(i(),a("section",R,[l(T,{title:"مشخصات",subtitle:"اطلاعات ثبتشده حساب شما"}),e("dl",w,[e("div",F,[o[0]||(o[0]=e("dt",null,"نام و نام خانوادگی",-1)),e("dd",null,t(s.value.fullName),1)]),e("div",M,[o[1]||(o[1]=e("dt",null,"تلفن همراه",-1)),e("dd",null,t(s.value.mobile),1)]),e("div",z,[o[2]||(o[2]=e("dt",null,"کد ملی",-1)),e("dd",null,t(s.value.nationalCode),1)]),e("div",L,[o[3]||(o[3]=e("dt",null,"وضعیت احراز هویت",-1)),e("dd",null,t(d[s.value.verificationStep]??s.value.verificationStep),1)])])])):n.value?_("",!0):(i(),a("section",O,[l(p,{icon:"vuesax-linear:user",size:"26"}),o[4]||(o[4]=e("p",null,"اطلاعات حساب در دسترس نیست.",-1))]))]}),_:1})])}}}),q=h(U,[["__scopeId","data-v-adfdabd9"]]);export{q as default};
|
||||
@@ -1 +0,0 @@
|
||||
.prof[data-v-7c544fc5]{background:#fff;min-height:100vh}.prof__body[data-v-7c544fc5]{padding-top:80px;padding-bottom:90px}.prof__identity[data-v-7c544fc5]{display:flex;flex-direction:column;align-items:center;text-align:center;padding:26px 20px 28px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.prof__avatar[data-v-7c544fc5]{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.prof__name[data-v-7c544fc5]{margin:14px 0 0;font-size:15.5px;font-weight:800;color:#14161a}.prof__mobile[data-v-7c544fc5]{margin:6px 0 0;font-size:12.5px;color:#5b616e;direction:ltr}.prof__seal[data-v-7c544fc5]{margin-top:12px;padding:5px 12px;border-radius:999px;font-size:11px;font-weight:700}.prof__seal.is-ok[data-v-7c544fc5]{color:#16a34a;background:#f0fdf4}.prof__seal.is-pending[data-v-7c544fc5]{color:#7a1b33;background:#fbf2f4}.prof__block[data-v-7c544fc5]{margin-top:26px}.prof__specs[data-v-7c544fc5]{margin:0;border:1px solid #ECEDEF;border-radius:18px;overflow:hidden}.prof__spec[data-v-7c544fc5]{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 14px;border-bottom:1px solid #F4F5F6}.prof__spec[data-v-7c544fc5]:last-child{border-bottom:0}.prof__spec dt[data-v-7c544fc5]{margin:0;font-size:12px;color:#8a909c}.prof__spec dd[data-v-7c544fc5]{margin:0;font-size:12.5px;font-weight:700;color:#14161a;text-align:left}.prof__empty[data-v-7c544fc5]{margin-top:26px;padding:34px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#8a909c}.prof__empty p[data-v-7c544fc5]{margin:0;font-size:12.5px}
|
||||
@@ -0,0 +1 @@
|
||||
.prof[data-v-adfdabd9]{background:#fff;min-height:100vh}.prof__body[data-v-adfdabd9]{padding-top:80px;padding-bottom:90px}.prof__identity[data-v-adfdabd9]{display:flex;flex-direction:column;align-items:center;text-align:center;padding:26px 20px 28px;border:1px solid #ECEDEF;border-radius:20px;background:#fafafa}.prof__avatar[data-v-adfdabd9]{width:72px;height:72px;border-radius:50%;display:grid;place-items:center;color:#7a1b33;background:#fbf2f4}.prof__name[data-v-adfdabd9]{margin:14px 0 0;font-size:15.5px;font-weight:800;color:#14161a}.prof__mobile[data-v-adfdabd9]{margin:6px 0 0;font-size:12.5px;color:#5b616e;direction:ltr}.prof__seal[data-v-adfdabd9]{margin-top:12px;padding:5px 12px;border-radius:999px;font-size:11px;font-weight:700}.prof__seal.is-ok[data-v-adfdabd9]{color:#16a34a;background:#f0fdf4}.prof__seal.is-pending[data-v-adfdabd9]{color:#7a1b33;background:#fbf2f4}.prof__block[data-v-adfdabd9]{margin-top:26px}.prof__specs[data-v-adfdabd9]{margin:0;border:1px solid #ECEDEF;border-radius:18px;overflow:hidden}.prof__spec[data-v-adfdabd9]{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:13px 14px;border-bottom:1px solid #F4F5F6}.prof__spec[data-v-adfdabd9]:last-child{border-bottom:0}.prof__spec dt[data-v-adfdabd9]{margin:0;font-size:12px;color:#8a909c}.prof__spec dd[data-v-adfdabd9]{margin:0;font-size:12.5px;font-weight:700;color:#14161a;text-align:left}.prof__empty[data-v-adfdabd9]{margin-top:26px;padding:34px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#8a909c}.prof__empty p[data-v-adfdabd9]{margin:0;font-size:12.5px}
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{p as n,j as d}from"./filters-CLL9nGZ2.js";import{d as l,c as s,i as u,b as a,C as m,t as i,u as c,e as _,h as v,f as r,_ as q}from"./index-CZjgV-Yn.js";const f={key:0,class:"rate-strip__value"},y={class:"rate-strip__num"},k={key:1,class:"rate-strip__value rate-strip__value--muted"},x={key:2,class:"rate-strip__time"},B=l({__name:"RateStrip",props:{quote:{},compact:{type:Boolean}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(C,e)=>(r(),s("div",{class:u(["rate-strip",{"is-empty":!t.quote,"rate-strip--compact":t.compact}])},[e[1]||(e[1]=a("div",{class:"rate-strip__label"},[a("span",{class:"rate-strip__dot","aria-hidden":"true"}),m(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),s("div",f,[a("span",y,i(c(n)(p.value)),1),e[0]||(e[0]=a("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),s("div",k,"در انتظار اعلام نرخ")),t.quote?(r(),s("div",x,i(c(d)(t.quote.quotedAt)),1)):_("",!0)],2))}}),h=q(B,[["__scopeId","data-v-0b16738e"]]);export{h as R};
|
||||
import{p as n,j as d}from"./filters-CLL9nGZ2.js";import{d as l,c as s,i as u,b as a,D as m,t as i,u as c,e as _,h as v,f as r,_ as q}from"./index-B3AQ-Dpo.js";const f={key:0,class:"rate-strip__value"},y={class:"rate-strip__num"},k={key:1,class:"rate-strip__value rate-strip__value--muted"},x={key:2,class:"rate-strip__time"},B=l({__name:"RateStrip",props:{quote:{},compact:{type:Boolean}},setup(t){const o=t,p=v(()=>o.quote?o.quote.pricePerGramRial.split(".")[0]:"");return(R,e)=>(r(),s("div",{class:u(["rate-strip",{"is-empty":!t.quote,"rate-strip--compact":t.compact}])},[e[1]||(e[1]=a("div",{class:"rate-strip__label"},[a("span",{class:"rate-strip__dot","aria-hidden":"true"}),m(" نرخ طلای ۱۸ عیار ")],-1)),t.quote?(r(),s("div",f,[a("span",y,i(c(n)(p.value)),1),e[0]||(e[0]=a("span",{class:"rate-strip__unit"},"ریال / گرم",-1))])):(r(),s("div",k,"در انتظار اعلام نرخ")),t.quote?(r(),s("div",x,i(c(d)(t.quote.quotedAt)),1)):_("",!0)],2))}}),C=q(B,[["__scopeId","data-v-0b16738e"]]);export{C as R};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{d as v,a1 as h,E as m,f as t,c as l,l as n,I as r,w as f,a2 as b,b as x,a3 as k,e as I,A as w,g as y,_ as C}from"./index-CZjgV-Yn.js";const S={class:"si"},V=["placeholder"],B=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=w({clear:!1}),e=y(void 0),s=()=>{c("search",e.value)},u=()=>{e.value=void 0,a.clear=!1,c("search",void 0)},p=h(e,700);return m(p,()=>{e?a.clear=!0:a.clear=!1,s()}),(N,o)=>(t(),l("div",S,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),f(x("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:k(s,["enter"])},null,40,V),[[b,e.value]]),a.clear?(t(),l("button",{key:0,type:"button",class:"si__clear","aria-label":"پاک کردن",onClick:u},[n(r,{icon:"vuesax-linear:add",size:"16"})])):I("",!0)]))}}),D=C(B,[["__scopeId","data-v-8ebd3183"]]);export{D as S};
|
||||
import{d as v,a2 as h,G as m,f as t,c as l,l as n,I as r,w as f,a3 as b,b as x,a4 as k,e as I,B as w,g as y,_ as B}from"./index-B3AQ-Dpo.js";const C={class:"si"},S=["placeholder"],V=v({__name:"SearchInput",props:{placeHolder:{}},emits:["search"],setup(i,{emit:d}){const c=d,a=w({clear:!1}),e=y(void 0),s=()=>{c("search",e.value)},u=()=>{e.value=void 0,a.clear=!1,c("search",void 0)},p=h(e,700);return m(p,()=>{e?a.clear=!0:a.clear=!1,s()}),(N,o)=>(t(),l("div",C,[n(r,{icon:"vuesax-linear:search-normal-1",class:"si__icon",size:"18",onClick:s}),f(x("input",{"onUpdate:modelValue":o[0]||(o[0]=_=>e.value=_),class:"si__input",placeholder:i.placeHolder,onKeyup:k(s,["enter"])},null,40,S),[[b,e.value]]),a.clear?(t(),l("button",{key:0,type:"button",class:"si__clear","aria-label":"پاک کردن",onClick:u},[n(r,{icon:"vuesax-linear:add",size:"16"})])):I("",!0)]))}}),D=B(V,[["__scopeId","data-v-8ebd3183"]]);export{D as S};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
@@ -1 +1 @@
|
||||
import{d as r,f as t,c as s,b as o,t as a,e as n,C as _,l as d,I as u,_ as b}from"./index-CZjgV-Yn.js";const m={class:"sec"},f={class:"sec__text"},x={class:"sec__title"},h={key:0,class:"sec__sub"},k=r({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(t(),s("header",m,[o("div",f,[o("h2",x,a(e.title),1),e.subtitle?(t(),s("p",h,a(e.subtitle),1)):n("",!0)]),e.actionLabel?(t(),s("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=v=>l("action"))},[_(a(e.actionLabel)+" ",1),d(u,{icon:"vuesax-linear:arrow-left-2",size:"15"})])):n("",!0)]))}}),C=b(k,[["__scopeId","data-v-e5c65b7c"]]);export{C as S};
|
||||
import{d as r,f as t,c as s,b as o,t as a,e as n,D as _,l as d,I as u,_ as b}from"./index-B3AQ-Dpo.js";const m={class:"sec"},f={class:"sec__text"},x={class:"sec__title"},h={key:0,class:"sec__sub"},k=r({__name:"SectionHead",props:{title:{},subtitle:{},actionLabel:{}},emits:["action"],setup(e,{emit:i}){const l=i;return(p,c)=>(t(),s("header",m,[o("div",f,[o("h2",x,a(e.title),1),e.subtitle?(t(),s("p",h,a(e.subtitle),1)):n("",!0)]),e.actionLabel?(t(),s("button",{key:0,type:"button",class:"sec__action",onClick:c[0]||(c[0]=v=>l("action"))},[_(a(e.actionLabel)+" ",1),d(u,{icon:"vuesax-linear:arrow-left-2",size:"15"})])):n("",!0)]))}}),N=b(k,[["__scopeId","data-v-e5c65b7c"]]);export{N as S};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
import{d as k,E as A,o as C,p as D,c as i,l as r,s as f,j as w,u as E,e as m,g as u,f as l,F as y,b as s,r as L,I as g,t as o,i as p,v as N,_ as M}from"./index-B3AQ-Dpo.js";import{P}from"./PageBar-Cvyz5ex2.js";import{a as O}from"./Spinner.vue_vue_type_style_index_0_lang-DKSb2qK3.js";import{S as B}from"./SectionHead-DRSKiTQc.js";import{j as R,p as U}from"./filters-CLL9nGZ2.js";import{D as I}from"./index-DxJlISvB.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-Bg7rxoGt.js";const V={class:"tx"},$={class:"tx__list"},Y=["onClick"],j={class:"tx__main"},z={class:"tx__head"},F={class:"tx__kind"},G={key:0,class:"tx__note"},H={class:"tx__foot"},J={class:"tx__date"},K={key:1,class:"tx__empty"},Q={class:"sheet"},W={class:"sheet__specs"},q={class:"sheet__spec"},X={class:"sheet__spec"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts=k({__name:"TransactionsView",setup(os){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آبشده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},T=A(),_=u(!1),d=u([]),v=u(!1),n=u(null),c=a=>a.direction==="CREDIT",h=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${U(a.amount)} ریال`,S=a=>{n.value=a,v.value=!0};return C(async()=>{if(T.isLoggedIn){_.value=!0;try{d.value=await D.getMyLedgerEntries()}finally{_.value=!1}}}),(a,e)=>{const b=N("container");return l(),i("div",V,[r(P,{title:"اسناد","back-to":"userPage::hasSubRoute"}),r(O,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[r(b,{class:"tx__body"},{default:f(()=>[d.value.length?(l(),i(y,{key:0},[r(B,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",$,[(l(!0),i(y,null,L(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ns=>S(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[r(g,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",j,[s("div",z,[s("h3",F,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(h(t)),3)]),t.note?(l(),i("p",G,o(t.note),1)):m("",!0),s("div",H,[s("span",J,o(E(R)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,Y))),128))])],64)):_.value?m("",!0):(l(),i("section",K,[r(g,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),w(E(I),{key:0,visible:v.value,"onUpdate:visible":e[0]||(e[0]=t=>v.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:f(()=>[s("div",Q,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",W,[s("div",q,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",X,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(h(n.value)),3)]),s("div",Z,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ss,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(E(R)(n.value.createdAt)),1)]),s("div",es,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):m("",!0)])}}}),ps=M(ts,[["__scopeId","data-v-d21f0dcb"]]);export{ps as default};
|
||||
@@ -0,0 +1 @@
|
||||
.tx[data-v-d21f0dcb]{background:#fff;min-height:100vh}.tx__body[data-v-d21f0dcb]{padding-top:76px;padding-bottom:90px}.tx__list[data-v-d21f0dcb]{display:flex;flex-direction:column;gap:10px}.tx__row[data-v-d21f0dcb]{display:flex;gap:11px;padding:12px;cursor:pointer;background:#fff;border:1px solid #ECEDEF;border-radius:18px;transition:transform .18s ease}.tx__row[data-v-d21f0dcb]:active{transform:scale(.99)}.tx__mark[data-v-d21f0dcb]{flex:0 0 36px;width:36px;height:36px;border-radius:50%;display:grid;place-items:center}.tx__mark.is-in[data-v-d21f0dcb]{color:#16a34a;background:#f0fdf4}.tx__mark.is-out[data-v-d21f0dcb]{color:#7a1b33;background:#fbf2f4}.tx__main[data-v-d21f0dcb]{flex:1;min-width:0}.tx__head[data-v-d21f0dcb]{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.tx__kind[data-v-d21f0dcb]{margin:0;font-size:13px;font-weight:700;color:#14161a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tx__amount[data-v-d21f0dcb]{font-size:12.5px;font-weight:800;white-space:nowrap}.tx__amount.is-in[data-v-d21f0dcb]{color:#16a34a}.tx__amount.is-out[data-v-d21f0dcb]{color:#7a1b33}.tx__note[data-v-d21f0dcb]{margin:6px 0 0;font-size:11.5px;line-height:1.7;color:#5b616e;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.tx__foot[data-v-d21f0dcb]{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:8px}.tx__date[data-v-d21f0dcb]{font-size:11px;color:#8a909c}.tx__state[data-v-d21f0dcb]{font-size:10.5px;font-weight:700;color:#5b616e}.tx__state.is-pending[data-v-d21f0dcb]{color:#916f48}.tx__empty[data-v-d21f0dcb]{margin-top:8px;padding:34px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#8a909c}.tx__empty p[data-v-d21f0dcb]{margin:0;font-size:12.5px}.sheet[data-v-d21f0dcb]{padding:18px 16px 22px}.sheet__title[data-v-d21f0dcb]{margin:0 0 14px;font-size:13.5px;font-weight:800;color:#14161a}.sheet__specs[data-v-d21f0dcb]{margin:0;border:1px solid #ECEDEF;border-radius:16px;overflow:hidden}.sheet__spec[data-v-d21f0dcb]{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border-bottom:1px solid #F4F5F6}.sheet__spec[data-v-d21f0dcb]:last-child{border-bottom:0}.sheet__spec dt[data-v-d21f0dcb]{margin:0;font-size:12px;color:#8a909c}.sheet__spec dd[data-v-d21f0dcb]{margin:0;font-size:12.5px;font-weight:700;color:#14161a;text-align:left}.sheet__spec dd.is-in[data-v-d21f0dcb]{color:#16a34a}.sheet__spec dd.is-out[data-v-d21f0dcb]{color:#7a1b33}
|
||||
@@ -1 +0,0 @@
|
||||
.tx[data-v-83b037a9]{background:#fff;min-height:100vh}.tx__body[data-v-83b037a9]{padding-top:76px;padding-bottom:90px}.tx__list[data-v-83b037a9]{display:flex;flex-direction:column;gap:10px}.tx__row[data-v-83b037a9]{display:flex;gap:11px;padding:12px;cursor:pointer;background:#fff;border:1px solid #ECEDEF;border-radius:18px;transition:transform .18s ease}.tx__row[data-v-83b037a9]:active{transform:scale(.99)}.tx__mark[data-v-83b037a9]{flex:0 0 36px;width:36px;height:36px;border-radius:50%;display:grid;place-items:center}.tx__mark.is-in[data-v-83b037a9]{color:#16a34a;background:#f0fdf4}.tx__mark.is-out[data-v-83b037a9]{color:#7a1b33;background:#fbf2f4}.tx__main[data-v-83b037a9]{flex:1;min-width:0}.tx__head[data-v-83b037a9]{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.tx__kind[data-v-83b037a9]{margin:0;font-size:13px;font-weight:700;color:#14161a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tx__amount[data-v-83b037a9]{font-size:12.5px;font-weight:800;white-space:nowrap}.tx__amount.is-in[data-v-83b037a9]{color:#16a34a}.tx__amount.is-out[data-v-83b037a9]{color:#7a1b33}.tx__note[data-v-83b037a9]{margin:6px 0 0;font-size:11.5px;line-height:1.7;color:#5b616e;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.tx__foot[data-v-83b037a9]{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:8px}.tx__date[data-v-83b037a9]{font-size:11px;color:#8a909c}.tx__state[data-v-83b037a9]{font-size:10.5px;font-weight:700;color:#5b616e}.tx__state.is-pending[data-v-83b037a9]{color:#916f48}.tx__empty[data-v-83b037a9]{margin-top:8px;padding:34px 20px;border:1px dashed #ECEDEF;border-radius:18px;display:flex;flex-direction:column;align-items:center;gap:10px;color:#8a909c}.tx__empty p[data-v-83b037a9]{margin:0;font-size:12.5px}.sheet[data-v-83b037a9]{padding:18px 16px 22px}.sheet__title[data-v-83b037a9]{margin:0 0 14px;font-size:13.5px;font-weight:800;color:#14161a}.sheet__specs[data-v-83b037a9]{margin:0;border:1px solid #ECEDEF;border-radius:16px;overflow:hidden}.sheet__spec[data-v-83b037a9]{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:12px 14px;border-bottom:1px solid #F4F5F6}.sheet__spec[data-v-83b037a9]:last-child{border-bottom:0}.sheet__spec dt[data-v-83b037a9]{margin:0;font-size:12px;color:#8a909c}.sheet__spec dd[data-v-83b037a9]{margin:0;font-size:12.5px;font-weight:700;color:#14161a;text-align:left}.sheet__spec dd.is-in[data-v-83b037a9]{color:#16a34a}.sheet__spec dd.is-out[data-v-83b037a9]{color:#7a1b33}
|
||||
@@ -1 +0,0 @@
|
||||
import{d as k,D as A,o as C,c as i,l as r,q as f,j as D,u as m,e as E,g as u,f as l,F as R,b as s,r as w,I as T,t as o,i as p,s as N,_ as L}from"./index-CZjgV-Yn.js";import{P}from"./PageBar-Bkc2Ht1O.js";import{a as M}from"./Spinner.vue_vue_type_style_index_0_lang-ghXHCVpI.js";import{S as O}from"./SectionHead-CiwUIGKe.js";import{j as g,p as B}from"./filters-CLL9nGZ2.js";import{a as I}from"./client-WIBW0tF5.js";import{D as U}from"./index-Ca8ka09f.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./classCallCheck-BSDY9VEy.js";const V={class:"tx"},$={class:"tx__list"},Y=["onClick"],j={class:"tx__main"},z={class:"tx__head"},F={class:"tx__kind"},G={key:0,class:"tx__note"},H={class:"tx__foot"},q={class:"tx__date"},J={key:1,class:"tx__empty"},K={class:"sheet"},Q={class:"sheet__specs"},W={class:"sheet__spec"},X={class:"sheet__spec"},Z={class:"sheet__spec"},ss={class:"sheet__spec"},es={class:"sheet__spec"},ts=k({__name:"TransactionsView",setup(os){const x={ORDER_STOCK:"سفارش",ORDER_PRE_ORDER:"سفارش ساخت",REPAYMENT_MELTED_GOLD:"طلای آبشده",REPAYMENT_TRANSFER:"حواله",REPAYMENT_CHEQUE:"چک",REPAYMENT_CASH:"پولی",WALLET_BONUS:"پاداش",ADJUSTMENT:"اصلاحیه"},h=A(),_=u(!1),d=u([]),v=u(!1),n=u(null),c=a=>a.direction==="CREDIT",y=a=>a.currency==="GOLD_GRAM"?`${a.amount} گرم`:`${B(a.amount)} ریال`,S=a=>{n.value=a,v.value=!0};return C(async()=>{if(h.customerId){_.value=!0;try{d.value=await I.getLedgerEntries(h.customerId)}finally{_.value=!1}}}),(a,e)=>{const b=N("container");return l(),i("div",V,[r(P,{title:"اسناد","back-to":"userPage::hasSubRoute"}),r(M,{spinning:_.value,tip:"درحال دریافت اطلاعات"},{default:f(()=>[r(b,{class:"tx__body"},{default:f(()=>[d.value.length?(l(),i(R,{key:0},[r(O,{title:"گردش حساب",subtitle:`${d.value.length} سند`},null,8,["subtitle"]),s("div",$,[(l(!0),i(R,null,w(d.value,t=>(l(),i("article",{key:t.id,class:"tx__row",onClick:ns=>S(t)},[s("span",{class:p(["tx__mark",c(t)?"is-in":"is-out"]),"aria-hidden":"true"},[r(T,{icon:c(t)?"vuesax-linear:arrow-down":"vuesax-linear:arrow-up",size:"16"},null,8,["icon"])],2),s("div",j,[s("div",z,[s("h3",F,o(x[t.sourceType]??t.sourceType),1),s("span",{class:p(["tx__amount",c(t)?"is-in":"is-out"])},o(y(t)),3)]),t.note?(l(),i("p",G,o(t.note),1)):E("",!0),s("div",H,[s("span",q,o(m(g)(t.createdAt)),1),s("span",{class:p(["tx__state",{"is-pending":!t.confirmed}])},o(t.confirmed?"تایید شده":"در انتظار تایید"),3)])])],8,Y))),128))])],64)):_.value?E("",!0):(l(),i("section",J,[r(T,{icon:"vuesax-linear:receipt-text",size:"26"}),e[1]||(e[1]=s("p",null,"سندی برای حساب شما ثبت نشده است.",-1))]))]),_:1})]),_:1},8,["spinning"]),n.value?(l(),D(m(U),{key:0,visible:v.value,"onUpdate:visible":e[0]||(e[0]=t=>v.value=t),placement:"bottom",closable:!1,height:"420px",class:"rtl",bodyStyle:{padding:0}},{default:f(()=>[s("div",K,[e[7]||(e[7]=s("h3",{class:"sheet__title"},"جزئیات سند",-1)),s("dl",Q,[s("div",W,[e[2]||(e[2]=s("dt",null,"نوع سند",-1)),s("dd",null,o(x[n.value.sourceType]??n.value.sourceType),1)]),s("div",X,[e[3]||(e[3]=s("dt",null,"مبلغ",-1)),s("dd",{class:p(c(n.value)?"is-in":"is-out")},o(y(n.value)),3)]),s("div",Z,[e[4]||(e[4]=s("dt",null,"وضعیت",-1)),s("dd",null,o(n.value.confirmed?"تایید شده":"در انتظار تایید"),1)]),s("div",ss,[e[5]||(e[5]=s("dt",null,"تاریخ",-1)),s("dd",null,o(m(g)(n.value.createdAt)),1)]),s("div",es,[e[6]||(e[6]=s("dt",null,"توضیحات",-1)),s("dd",null,o(n.value.note||"—"),1)])])])]),_:1},8,["visible"])):E("",!0)])}}}),vs=L(ts,[["__scopeId","data-v-83b037a9"]]);export{vs as default};
|
||||
@@ -1 +0,0 @@
|
||||
import{g as d,u as F,h as i,m as S}from"./index-CZjgV-Yn.js";import{a as P}from"./client-WIBW0tF5.js";function W(t){return!t||t.length===0?null:t.reduce((e,s)=>parseFloat(s.defaultWagePercent)<parseFloat(e.defaultWagePercent)?s:e)}function I(t,e){const s=d(t),r=i(()=>{var n,m;return(m=(n=s.value.images)==null?void 0:n[0])==null?void 0:m.url}),o=i(()=>s.value.id),u=i(()=>s.value.title),l=i(()=>s.value.variants),a=d(e??W(F(l))),v=i(()=>a.value?parseFloat(a.value.rashWeightGrams):0),g=i(()=>a.value?parseFloat(a.value.defaultWagePercent):null),x=d(null),h=i(()=>{var n;return((n=a.value)==null?void 0:n.qty)??0}),f=i(()=>{var n;return((n=a.value)==null?void 0:n.isPreOrder)??!1}),y=i(()=>h.value>0||f.value),_=i(()=>s.value.productCode??null),C=d(!1);return{product:s,image:r,id:o,title:u,productCode:_,variants:l,selectedVariant:a,min_gram:v,wage:g,hasDiscountWage:x,qty:h,isPreOrder:f,is_exist:y,has_warranty:C}}const p="appCart";function q(){try{const t=localStorage.getItem(p);return t?JSON.parse(t):[]}catch{return[]}}function c(t){localStorage.setItem(p,JSON.stringify(t))}const G=S("cart",{state:()=>({items:q()}),actions:{async init(){try{const t=await P.listProducts(),e=[];for(const s of this.items){const r=t.find(u=>u.id===s.pid),o=r==null?void 0:r.variants.find(u=>u.id===s.vid);r&&o&&e.push({...s,product:r})}this.items=e,c(this.items)}catch(t){console.log(t)}},addToCart(t){const e=this.find_index(t);e===-1?this.items.push(t):(this.items[e].product=t.product,this.items[e].qty=t.qty),c(this.items)},remove(t){const e=this.find_index(t);e>-1&&this.items.splice(e,1),c(this.items)},updateFeild(t,e,s,r){if(!this.isInCart(s))return!1;const o=e??this.find_index(s);return this.items[o][r]=t,c(this.items),!0},find_index(t){return this.items.findIndex(e=>e.pid===t.pid&&e.vid===t.vid)},isInCart(t){return this.find_index(t)>-1},variant(t){return t.product.variants.find(e=>e.id===t.vid)},total(){return this.items.reduce((t,e)=>{const s=this.variant(e);return t+(s?parseFloat(s.rashWeightGrams)*e.qty:0)},0).toFixed(2)},clear(){this.items=[],c(this.items)}}});export{G as a,I as u};
|
||||
@@ -0,0 +1 @@
|
||||
import{g as d,u as F,h as i,m as S,p as P}from"./index-B3AQ-Dpo.js";function W(t){return!t||t.length===0?null:t.reduce((e,s)=>parseFloat(s.defaultWagePercent)<parseFloat(e.defaultWagePercent)?s:e)}function w(t,e){const s=d(t),r=i(()=>{var n,p;return(p=(n=s.value.images)==null?void 0:n[0])==null?void 0:p.url}),o=i(()=>s.value.id),u=i(()=>s.value.title),l=i(()=>s.value.variants),a=d(e??W(F(l))),v=i(()=>a.value?parseFloat(a.value.rashWeightGrams):0),g=i(()=>a.value?parseFloat(a.value.defaultWagePercent):null),x=d(null),h=i(()=>{var n;return((n=a.value)==null?void 0:n.qty)??0}),f=i(()=>{var n;return((n=a.value)==null?void 0:n.isPreOrder)??!1}),y=i(()=>h.value>0||f.value),_=i(()=>s.value.productCode??null),C=d(!1);return{product:s,image:r,id:o,title:u,productCode:_,variants:l,selectedVariant:a,min_gram:v,wage:g,hasDiscountWage:x,qty:h,isPreOrder:f,is_exist:y,has_warranty:C}}const m="appCart";function q(){try{const t=localStorage.getItem(m);return t?JSON.parse(t):[]}catch{return[]}}function c(t){localStorage.setItem(m,JSON.stringify(t))}const I=S("cart",{state:()=>({items:q()}),actions:{async init(){try{const t=await P.listProducts(),e=[];for(const s of this.items){const r=t.find(u=>u.id===s.pid),o=r==null?void 0:r.variants.find(u=>u.id===s.vid);r&&o&&e.push({...s,product:r})}this.items=e,c(this.items)}catch(t){console.log(t)}},addToCart(t){const e=this.find_index(t);e===-1?this.items.push(t):(this.items[e].product=t.product,this.items[e].qty=t.qty),c(this.items)},remove(t){const e=this.find_index(t);e>-1&&this.items.splice(e,1),c(this.items)},updateFeild(t,e,s,r){if(!this.isInCart(s))return!1;const o=e??this.find_index(s);return this.items[o][r]=t,c(this.items),!0},find_index(t){return this.items.findIndex(e=>e.pid===t.pid&&e.vid===t.vid)},isInCart(t){return this.find_index(t)>-1},variant(t){return t.product.variants.find(e=>e.id===t.vid)},total(){return this.items.reduce((t,e)=>{const s=this.variant(e);return t+(s?parseFloat(s.rashWeightGrams)*e.qty:0)},0).toFixed(2)},clear(){this.items=[],c(this.items)}}});export{I as a,w as u};
|
||||
+1
-1
@@ -1 +1 @@
|
||||
import{c as l}from"./Spinner.vue_vue_type_style_index_0_lang-ghXHCVpI.js";var f=function(n){return setTimeout(n,16)},c=function(n){return clearTimeout(n)};typeof window<"u"&&"requestAnimationFrame"in window&&(f=function(n){return window.requestAnimationFrame(n)},c=function(n){return window.cancelAnimationFrame(n)});var i=0,o=new Map;function u(e){o.delete(e)}function w(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;i+=1;var r=i;function a(t){if(t===0)u(r),e();else{var s=f(function(){a(t-1)});o.set(r,s)}}return a(n),r}w.cancel=function(e){var n=o.get(e);return u(n),c(n)};function m(e,n){for(var r=l({},e),a=0;a<n.length;a+=1){var t=n[a];delete r[t]}return r}function p(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}export{p as _,v as a,m as o,w};
|
||||
import{c as l}from"./Spinner.vue_vue_type_style_index_0_lang-DKSb2qK3.js";var f=function(n){return setTimeout(n,16)},c=function(n){return clearTimeout(n)};typeof window<"u"&&"requestAnimationFrame"in window&&(f=function(n){return window.requestAnimationFrame(n)},c=function(n){return window.cancelAnimationFrame(n)});var i=0,o=new Map;function u(e){o.delete(e)}function w(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;i+=1;var r=i;function a(t){if(t===0)u(r),e();else{var s=f(function(){a(t-1)});o.set(r,s)}}return a(n),r}w.cancel=function(e){var n=o.get(e);return u(n),c(n)};function m(e,n){for(var r=l({},e),a=0;a<n.length;a+=1){var t=n[a];delete r[t]}return r}function p(e,n,r){return Object.defineProperty(e,"prototype",{writable:!1}),e}function v(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}export{p as _,v as a,m as o,w};
|
||||
@@ -1 +0,0 @@
|
||||
const a="/api";async function t(e,r){const s=await fetch(`${a}${e}`,{headers:{"Content-Type":"application/json"},...r});if(!s.ok){const o=await s.text();throw new Error(`API ${e} failed (${s.status}): ${o}`)}return s.json()}const c={listProducts:()=>t("/catalog/products"),listCustomers:()=>t("/customers"),getCustomer:e=>t(`/customers/${e}`),getBalance:e=>t(`/accounting/customers/${e}/balance`),getLedgerEntries:e=>t(`/customers/${e}/ledger-entries`),createOrder:e=>t("/orders",{method:"POST",body:JSON.stringify(e)}),getCustomerOrders:e=>t(`/customers/${e}/orders`),getLatestGoldPrice:(e=750)=>t(`/pricing/latest?karatPerMille=${e}`)};export{c as a};
|
||||
@@ -0,0 +1 @@
|
||||
import{a5 as y,d as L,a6 as $,a7 as w,G as A,a8 as B,l as c,g as D,B as N,L as p,a9 as G,q as I,aa as f,ab as M,ac as R,ad as U}from"./index-B3AQ-Dpo.js";const[Y,r,q]=y("pull-refresh"),x=50,C=["pulling","loosing","success"],F={disabled:Boolean,modelValue:Boolean,headHeight:f(x),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:$,successDuration:f(500),animationDuration:f(300)};var X=L({name:Y,props:F,emits:["change","refresh","update:modelValue"],setup(s,{emit:d,slots:o}){let u;const g=D(),T=D(),H=w(g),e=N({status:"normal",distance:0,duration:0}),i=R(),P=()=>{if(s.headHeight!==x)return{height:`${s.headHeight}px`}},h=()=>e.status!=="loading"&&e.status!=="success"&&!s.disabled,k=t=>{const a=+(s.pullDistance||s.headHeight);return t>a&&(t<a*2?t=a+(t-a)/2:t=a*1.5+(t-a*2)/4),Math.round(t)},n=(t,a)=>{const l=+(s.pullDistance||s.headHeight);e.distance=t,a?e.status="loading":t===0?e.status="normal":t<l?e.status="pulling":e.status="loosing",d("change",{status:e.status,distance:t})},m=()=>{const{status:t}=e;return t==="normal"?"":s[`${t}Text`]||q(t)},E=()=>{const{status:t,distance:a}=e;if(o[t])return o[t]({distance:a});const l=[];return C.includes(t)&&l.push(c("div",{class:r("text")},[m()])),t==="loading"&&l.push(c(p,{class:r("loading")},{default:m})),l},V=()=>{e.status="success",setTimeout(()=>{n(0)},+s.successDuration)},v=t=>{u=M(H.value)===0,u&&(e.duration=0,i.start(t))},b=t=>{h()&&v(t)},_=t=>{if(h()){u||v(t);const{deltaY:a}=i;i.move(t),u&&a.value>=0&&i.isVertical()&&(G(t),n(k(a.value)))}},S=()=>{u&&i.deltaY.value&&h()&&(e.duration=+s.animationDuration,e.status==="loosing"?(n(+s.headHeight,!0),d("update:modelValue",!0),I(()=>d("refresh"))):n(0))};return A(()=>s.modelValue,t=>{e.duration=+s.animationDuration,t?n(+s.headHeight,!0):o.success||s.successText?V():n(0,!1)}),B("touchmove",_,{target:T}),()=>{var t;const a={transitionDuration:`${e.duration}ms`,transform:e.distance?`translate3d(0,${e.distance}px, 0)`:""};return c("div",{ref:g,class:r()},[c("div",{ref:T,class:r("track"),style:a,onTouchstartPassive:b,onTouchend:S,onTouchcancel:S},[c("div",{class:r("head"),style:P()},[E()]),(t=o.default)==null?void 0:t.call(o)])])}}});const z=U(X);export{z as P};
|
||||
Vendored
+13
-13
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
import{a4 as y,d as A,a5 as L,a6 as $,E as p,a7 as w,l as c,g as D,A as N,L as B,a8 as I,p as M,a9 as f,aa as R,ab as U,ac as Y}from"./index-CZjgV-Yn.js";const[C,r,F]=y("pull-refresh"),x=50,G=["pulling","loosing","success"],X={disabled:Boolean,modelValue:Boolean,headHeight:f(x),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:L,successDuration:f(500),animationDuration:f(300)};var j=A({name:C,props:X,emits:["change","refresh","update:modelValue"],setup(s,{emit:d,slots:o}){let u;const g=D(),T=D(),H=$(g),e=N({status:"normal",distance:0,duration:0}),i=U(),P=()=>{if(s.headHeight!==x)return{height:`${s.headHeight}px`}},h=()=>e.status!=="loading"&&e.status!=="success"&&!s.disabled,E=t=>{const a=+(s.pullDistance||s.headHeight);return t>a&&(t<a*2?t=a+(t-a)/2:t=a*1.5+(t-a*2)/4),Math.round(t)},n=(t,a)=>{const l=+(s.pullDistance||s.headHeight);e.distance=t,a?e.status="loading":t===0?e.status="normal":t<l?e.status="pulling":e.status="loosing",d("change",{status:e.status,distance:t})},m=()=>{const{status:t}=e;return t==="normal"?"":s[`${t}Text`]||F(t)},k=()=>{const{status:t,distance:a}=e;if(o[t])return o[t]({distance:a});const l=[];return G.includes(t)&&l.push(c("div",{class:r("text")},[m()])),t==="loading"&&l.push(c(B,{class:r("loading")},{default:m})),l},V=()=>{e.status="success",setTimeout(()=>{n(0)},+s.successDuration)},v=t=>{u=R(H.value)===0,u&&(e.duration=0,i.start(t))},b=t=>{h()&&v(t)},_=t=>{if(h()){u||v(t);const{deltaY:a}=i;i.move(t),u&&a.value>=0&&i.isVertical()&&(I(t),n(E(a.value)))}},S=()=>{u&&i.deltaY.value&&h()&&(e.duration=+s.animationDuration,e.status==="loosing"?(n(+s.headHeight,!0),d("update:modelValue",!0),M(()=>d("refresh"))):n(0))};return p(()=>s.modelValue,t=>{e.duration=+s.animationDuration,t?n(+s.headHeight,!0):o.success||s.successText?V():n(0,!1)}),w("touchmove",_,{target:T}),()=>{var t;const a={transitionDuration:`${e.duration}ms`,transform:e.distance?`translate3d(0,${e.distance}px, 0)`:""};return c("div",{ref:g,class:r()},[c("div",{ref:T,class:r("track"),style:a,onTouchstartPassive:b,onTouchend:S,onTouchcancel:S},[c("div",{class:r("head"),style:P()},[k()]),(t=o.default)==null?void 0:t.call(o)])])}}});const z=Y(j);export{z as P};
|
||||
Vendored
+4
-4
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -9,7 +9,7 @@
|
||||
<meta name="background-color" content="#1C2D56" />
|
||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
|
||||
<title>طلای منتزر</title>
|
||||
<script type="module" crossorigin src="/assets/index-CZjgV-Yn.js"></script>
|
||||
<script type="module" crossorigin src="/assets/index-B3AQ-Dpo.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-D-jEuKqG.css">
|
||||
<link rel="manifest" href="/manifest.webmanifest"></head>
|
||||
<body style="background-color: #1C2D56">
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -36,7 +36,13 @@
|
||||
not last, to land there. Keep both steppers' DOM order in sync if
|
||||
either one changes. -->
|
||||
<div class="ci__qty">
|
||||
<button type="button" class="ci__qtyBtn" aria-label="افزودن" @click="increment">
|
||||
<button
|
||||
type="button"
|
||||
class="ci__qtyBtn"
|
||||
aria-label="افزودن"
|
||||
:disabled="!canIncrement"
|
||||
@click="increment"
|
||||
>
|
||||
<Icon icon="vuesax-linear:add" size="16" />
|
||||
</button>
|
||||
<span class="ci__qtyValue">{{ value.qty }}</span>
|
||||
@@ -77,7 +83,13 @@ const emit = defineEmits<{ (e: 'note', value: number): void }>()
|
||||
const cart = useCartStore()
|
||||
const index = cart.find_index(props.value)
|
||||
|
||||
// Stock ceiling, same rule as the product page: uncapped for a pre-order
|
||||
// variant, otherwise limited to what is on hand. The store clamps as well.
|
||||
const maxQty = computed(() => cart.maxQty(props.value))
|
||||
const canIncrement = computed(() => maxQty.value === null || props.value.qty < maxQty.value)
|
||||
|
||||
const increment = () => {
|
||||
if (!canIncrement.value) return
|
||||
cart.updateFeild(props.value.qty + 1, index, props.value, 'qty')
|
||||
}
|
||||
const decrement = () => {
|
||||
|
||||
@@ -149,7 +149,8 @@
|
||||
:key="item.id"
|
||||
type="button"
|
||||
class="pd__chip"
|
||||
:class="{ 'is-on': selectedVariant?.id === item.id }"
|
||||
:class="{ 'is-on': selectedVariant?.id === item.id, 'is-out': !isOrderable(item) }"
|
||||
:disabled="!isOrderable(item)"
|
||||
@click="selectedVariant = item"
|
||||
>
|
||||
{{ item.title }}
|
||||
@@ -324,7 +325,7 @@ import GallerySlider from './GallerySlider.vue'
|
||||
import Spinner from '../Spinner.vue'
|
||||
import NotifyVant from '../NotifyVant.vue'
|
||||
import DialogVant from '../DialogVant.vue'
|
||||
import { useProduct } from '../../composables/useProduct'
|
||||
import { useProduct, isVariantOrderable } from '../../composables/useProduct'
|
||||
import { useProductDetail } from '../../composables/useProductDetail'
|
||||
import { useFavoritesStore } from '../../stores/favoritesStore'
|
||||
import { useFiltersStore } from '../../stores/filtersStore'
|
||||
@@ -477,7 +478,14 @@ const inCart = computed(() => cart.isInCart(storeProduct.value))
|
||||
const cartIndex = computed(() => cart.find_index(storeProduct.value))
|
||||
const cartQty = computed(() => (cartIndex.value > -1 ? cart.items[cartIndex.value].qty : 0))
|
||||
|
||||
const increment = () => cart.updateFeild(cartQty.value + 1, cartIndex.value, storeProduct.value, 'qty')
|
||||
// Stock ceiling: a pre-order variant may exceed what is on hand, anything else
|
||||
// stops at its qty. The store clamps too — this just keeps the button honest.
|
||||
const cartMaxQty = computed(() => cart.maxQty(storeProduct.value))
|
||||
const canIncrement = computed(() => cartMaxQty.value === null || cartQty.value < cartMaxQty.value)
|
||||
const increment = () => {
|
||||
if (!canIncrement.value) return
|
||||
cart.updateFeild(cartQty.value + 1, cartIndex.value, storeProduct.value, 'qty')
|
||||
}
|
||||
const decrement = () => {
|
||||
if (cartQty.value <= 1) {
|
||||
cart.remove(storeProduct.value)
|
||||
@@ -486,8 +494,11 @@ const decrement = () => {
|
||||
cart.updateFeild(cartQty.value - 1, cartIndex.value, storeProduct.value, 'qty')
|
||||
}
|
||||
|
||||
const isOrderable = (v: Parameters<typeof isVariantOrderable>[0]) => isVariantOrderable(v)
|
||||
|
||||
const addToCart = () => {
|
||||
cart.addToCart(storeProduct.value)
|
||||
// The store refuses an un-orderable variant; only confirm when it accepted.
|
||||
if (!cart.addToCart(storeProduct.value)) return
|
||||
notify.value = true
|
||||
}
|
||||
|
||||
@@ -1127,6 +1138,12 @@ onBeforeUnmount(() => {
|
||||
background: @ink;
|
||||
border-color: @ink;
|
||||
}
|
||||
/* Same treatment as v1's .pd__variant.is-out: an un-orderable weight stays
|
||||
visible (so the customer can see it exists) but reads as unavailable. */
|
||||
.pd__chip.is-out {
|
||||
opacity: 0.45;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
/* ── Blocks ──────────────────────────────────────────────── */
|
||||
.pd__block {
|
||||
|
||||
@@ -21,9 +21,20 @@
|
||||
import { computed, ref, unref, type Ref } from 'vue'
|
||||
import type { ProductSummary, ProductVariantSummary } from '../api/client'
|
||||
|
||||
/** A variant can be ordered when it has stock, or when it is flagged pre-order. */
|
||||
export function isVariantOrderable(v: ProductVariantSummary): boolean {
|
||||
return (v.qty ?? 0) > 0 || Boolean(v.isPreOrder)
|
||||
}
|
||||
|
||||
function getCheapestVariant(variants: ProductVariantSummary[] | undefined): ProductVariantSummary | null {
|
||||
if (!variants || variants.length === 0) return null
|
||||
return variants.reduce((cheapest, v) =>
|
||||
// Prefer something the customer can actually order: defaulting to an
|
||||
// out-of-stock variant means the page opens on a disabled button even though
|
||||
// other weights are available. Falls back to the full list when nothing is
|
||||
// orderable, so the page still shows a selection.
|
||||
const pool = variants.filter(isVariantOrderable)
|
||||
const candidates = pool.length ? pool : variants
|
||||
return candidates.reduce((cheapest, v) =>
|
||||
parseFloat(v.defaultWagePercent) < parseFloat(cheapest.defaultWagePercent) ? v : cheapest,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -54,13 +54,42 @@ export const useCartStore = defineStore('cart', {
|
||||
}
|
||||
},
|
||||
addToCart(data: CartItem) {
|
||||
// Refuse a variant that cannot be ordered — out of stock and not flagged
|
||||
// pre-order. The same guard the admin cart applies (stores/cart.ts), kept
|
||||
// here so it holds even if a caller forgets to disable its button.
|
||||
const target = data.product?.variants?.find((v) => v.id === data.vid)
|
||||
if (!target) return false
|
||||
if (!((target.qty ?? 0) > 0 || target.isPreOrder)) return false
|
||||
|
||||
const index = this.find_index(data)
|
||||
if (index === -1) this.items.push(data)
|
||||
if (index === -1) this.items.push({ ...data, qty: this.capQty(data.qty, target) })
|
||||
else {
|
||||
this.items[index].product = data.product
|
||||
this.items[index].qty = data.qty
|
||||
this.items[index].qty = this.capQty(data.qty, target)
|
||||
}
|
||||
persist(this.items)
|
||||
return true
|
||||
},
|
||||
|
||||
/**
|
||||
* Stock ceiling for a cart line. A pre-order variant is orderable beyond
|
||||
* what is on hand (that is the point of pre-ordering), so it is uncapped;
|
||||
* anything else stops at its on-hand quantity.
|
||||
*/
|
||||
capQty(want: number, variant: { qty?: number; isPreOrder?: boolean }) {
|
||||
const n = Math.max(1, Math.floor(want) || 1)
|
||||
if (variant.isPreOrder) return n
|
||||
const max = variant.qty ?? 0
|
||||
return max > 0 ? Math.min(n, max) : n
|
||||
},
|
||||
|
||||
/** The ceiling for an item already in the cart; null when uncapped. */
|
||||
maxQty(item: Pick<CartItem, 'pid' | 'vid'>) {
|
||||
const i = this.find_index(item)
|
||||
if (i === -1) return null
|
||||
const v = this.variant(this.items[i])
|
||||
if (!v || v.isPreOrder) return null
|
||||
return (v.qty ?? 0) > 0 ? (v.qty as number) : null
|
||||
},
|
||||
remove(item: CartItem) {
|
||||
const index = this.find_index(item)
|
||||
@@ -72,6 +101,13 @@ export const useCartStore = defineStore('cart', {
|
||||
updateFeild(value: unknown, index: number | null, item: Pick<CartItem, 'pid' | 'vid'>, field: keyof CartItem) {
|
||||
if (!this.isInCart(item)) return false
|
||||
const i = index ?? this.find_index(item)
|
||||
// A quantity change is clamped to what is actually in stock (unless the
|
||||
// variant is pre-orderable), so the ceiling holds no matter which screen
|
||||
// drives the stepper.
|
||||
if (field === 'qty') {
|
||||
const v = this.variant(this.items[i])
|
||||
value = v ? this.capQty(Number(value), v) : Math.max(1, Number(value) || 1)
|
||||
}
|
||||
;(this.items[i] as any)[field] = value
|
||||
persist(this.items)
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user