"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[158],{3483:function(s,e,a){var c=a(7842),t=a(1212),n=a(467),r=a(5544),o=a(118),i=a(758),l=a.n(i),h=a(6540),p=a(2371),d=a(9201),m=a(5414),x=a(9703),u=a(9674),g=a(3053),j=a(9513),b=a(4848),f=function(s,e,a){return Math.min(Math.max(s,e),a)},N=function(s,e,a){return s+(e-s)*a},y=function(s){return 1-Math.pow(1-s,3)};function S(){var s=(0,x.wR)(),e=s.resolvedTheme,a=(0,h.useState)(667),c=(0,r.A)(a,2),i=c[0],S=c[1],v=(0,h.useState)(0),k=(0,r.A)(v,2),Y=k[0],E=k[1],w=(0,h.useState)(null),A=(0,r.A)(w,2),T=A[0],O=A[1],P=(0,h.useState)(!0),B=(0,r.A)(P,2),C=B[0],M=B[1],I=(0,h.useState)(""),H=(0,r.A)(I,2),F=H[0],J=H[1],D=(0,d.c)();(0,m.l)(e,{mode:"light"});var R=l().getCurrentInstance().router,V=R?R.params:void 0,W=V?V.id:"",_=(0,h.useCallback)((0,n.A)((0,t.A)().m(function s(){var e,a;return(0,t.A)().w(function(s){while(1)switch(s.p=s.n){case 0:if(W){s.n=1;break}return J("\u7f3a\u5c11\u5546\u54c1 ID"),M(!1),s.a(2);case 1:return M(!0),J(""),s.p=2,e=O,s.n=3,(0,p.yj)(W);case 3:e(s.v),s.n=5;break;case 4:s.p=4,a=s.v,J(a instanceof Error?a.message:"\u5546\u54c1\u52a0\u8f7d\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5");case 5:return s.p=5,M(!1),s.f(5);case 6:return s.a(2)}},s,null,[[2,4,5,6]])})),[W]);(0,h.useEffect)(function(){_()},[_]),(0,h.useEffect)(function(){try{var s=l().getSystemInfoSync();S(s.windowHeight)}catch(s){}},[]);var q=(0,h.useCallback)(function(s){var e=s.detail&&s.detail.scrollTop||0,a=1.2*i,c=f(e/a,0,1);E(c)},[i]),z=(0,h.useMemo)(function(){var s=Y,e=0,a=0;if(s<=.4){var c=y(s/.4);e=N(0,32,c),a=N(0,38,c)}else if(s<=.55){var t=(s-.4)/.15;e=N(32,34,t),a=N(38,41,t)}else e=34,a=41;var n=0;n=s<=.4?0:s<=.7?N(0,-75,(s-.4)/.3):-75;var r=1;r=s<=.35?1:s<=.48?f(1-(s-.35)/.13,0,1):0;var o=0;o=s<=.55?0:s<=.7?(s-.55)/.15:1;var i=1,l=0;if(s<=.05)i=0,l=60;else if(s<=.22){var h=(s-.05)/.17;i=y(h),l=N(60,0,y(h))}var p=1;return s<=.15&&(p=f(1-s/.15,0,1)),{topCrop:e,bottomCrop:a,translateY:n,heroInfoOpacity:r,bandOpacity:o,contentOpacity:i,contentOffset:l,backBtnOpacity:p,visibleHeight:100-e-a}},[Y]),G=(0,h.useMemo)(function(){return T?T.tone:[28,22,18]},[T]);return C?(0,b.jsxs)(o.Ss,{className:"shop-detail-page theme-dark",children:[(0,b.jsx)(u.A,{darkTop:!0}),(0,b.jsx)(o.EY,{style:{color:"#fff",padding:"40rpx"},children:"\u6b63\u5728\u52a0\u8f7d\u5546\u54c1\u2026"})]}):T?(0,b.jsxs)(o.Ss,{className:"shop-detail-page theme-dark",children:[(0,b.jsx)(u.A,{darkTop:!0}),(0,b.jsx)(g.A,{title:"\u5546\u54c1\u8be6\u60c5",targetSelector:".shop-back-btn",showBack:!0}),(0,b.jsxs)(o.Ss,{className:"shop-hero-fixed",children:[(0,b.jsx)(o.Ss,{className:"shop-hero-clip",style:{height:"".concat(i*z.visibleHeight/100,"px"),overflow:"hidden",transform:"translateY(".concat(i*z.translateY/100,"px)")},children:(0,b.jsx)(o._V,{className:"shop-hero-img",src:T.images&&T.images[0]||T.iconImg||"",mode:"aspectFill",style:{width:"100%",height:"".concat(i,"px"),position:"absolute",top:"".concat(-i*z.topCrop/100,"px"),left:0}})}),(0,b.jsx)(o.Ss,{className:"shop-hero-overlay",style:{background:"linear-gradient(to bottom, rgba(".concat(G[0],", ").concat(G[1],", ").concat(G[2],", 0) 0%, rgba(").concat(G[0],", ").concat(G[1],", ").concat(G[2],", 0.55) 40%, rgba(").concat(G[0],", ").concat(G[1],", ").concat(G[2],", 0.95) 100%)")}}),(0,b.jsxs)(o.Ss,{className:"shop-hero-info",style:{opacity:z.heroInfoOpacity},children:[(0,b.jsx)(o.EY,{className:"shop-hero-title",children:T.name}),(0,b.jsx)(o.EY,{className:"shop-hero-subtitle",children:T.subtitle||T.desc}),(0,b.jsxs)(o.Ss,{className:"shop-hero-price-row",children:[(0,b.jsxs)(o.EY,{className:"shop-hero-price",children:["\xa5",T.price]}),T.originalPrice&&T.originalPrice>T.price&&(0,b.jsxs)(o.EY,{className:"shop-hero-original",children:["\xa5",T.originalPrice]})]})]})]}),(0,b.jsxs)(o.BM,{className:"shop-scroll",scrollY:!0,scrollEventThrottle:16,style:{height:"".concat(i,"px")},onScroll:q,children:[(0,b.jsx)(o.Ss,{style:{height:"".concat(.65*i,"px")}}),(0,b.jsxs)(o.Ss,{className:"shop-content",style:{backgroundColor:"rgb(".concat(G[0],", ").concat(G[1],", ").concat(G[2],")")},children:[(0,b.jsxs)(o.Ss,{className:"shop-band",style:{top:"".concat(D.statusBarHeight,"px"),opacity:z.bandOpacity,backgroundColor:"rgba(".concat(G[0],", ").concat(G[1],", ").concat(G[2],", 0.88)"),backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[(0,b.jsx)(o.EY,{className:"shop-band-title",children:T.name}),(0,b.jsx)(o.EY,{className:"shop-band-subtitle",children:T.subtitle||T.desc}),(0,b.jsxs)(o.Ss,{className:"shop-band-price-row",children:[(0,b.jsxs)(o.EY,{className:"shop-band-price",children:["\xa5",T.price]}),T.originalPrice&&T.originalPrice>T.price&&(0,b.jsxs)(o.EY,{className:"shop-band-original",children:["\xa5",T.originalPrice]})]})]}),(0,b.jsxs)(o.Ss,{className:"shop-detail-body",style:{opacity:z.contentOpacity,transform:"translateY(".concat(z.contentOffset,"px)")},children:[(0,b.jsxs)(o.Ss,{className:"shop-content-card",children:[T.story&&(0,b.jsxs)(o.Ss,{className:"shop-section",children:[(0,b.jsx)(o.EY,{className:"shop-section-title",children:"\u8bbe\u8ba1\u7406\u5ff5"}),(0,b.jsx)(o.EY,{className:"shop-section-text",children:T.story})]}),T.story&&T.scene&&(0,b.jsx)(o.Ss,{className:"shop-divider"}),T.scene&&(0,b.jsxs)(o.Ss,{className:"shop-section",children:[(0,b.jsx)(o.EY,{className:"shop-section-title",children:"\u4f7f\u7528\u573a\u666f"}),(0,b.jsx)(o.EY,{className:"shop-section-text",children:T.scene})]}),T.tags&&T.tags.length>0&&(0,b.jsx)(o.Ss,{className:"shop-section",children:(0,b.jsx)(o.Ss,{className:"shop-tag-row",children:T.tags.map(function(s){return(0,b.jsx)(o.Ss,{className:"shop-tag",children:(0,b.jsx)(o.EY,{className:"shop-tag-text",children:s})},s)})})}),(T.story||T.scene)&&T.tags&&T.tags.length>0&&(0,b.jsx)(o.Ss,{className:"shop-divider"}),(T.story||T.scene||T.tags&&T.tags.length>0)&&T.specs&&T.specs.length>0&&(0,b.jsx)(o.Ss,{className:"shop-divider"}),T.specs&&T.specs.length>0&&(0,b.jsxs)(o.Ss,{className:"shop-section",children:[(0,b.jsx)(o.EY,{className:"shop-section-title",children:"\u89c4\u683c\u53c2\u6570"}),(0,b.jsx)(o.Ss,{className:"shop-spec-table",children:T.specs.map(function(s){var e=(0,r.A)(s,2),a=e[0],c=e[1];return(0,b.jsxs)(o.Ss,{className:"shop-spec-row",children:[(0,b.jsx)(o.EY,{className:"shop-spec-key",children:a}),(0,b.jsx)(o.EY,{className:"shop-spec-val",children:c})]},a)})})]})]}),(0,b.jsx)(o.Ss,{className:"shop-bottom-spacer"})]})]})]},T.id),(0,b.jsx)(o.Ss,{className:"shop-back-btn",onTap:function(){return l().navigateBack()},style:{top:"".concat(D.menuButtonTop,"px"),opacity:z.backBtnOpacity},children:(0,b.jsx)(o.EY,{className:"shop-back-arrow",children:"\u2190"})}),(0,b.jsxs)(j.A,{children:[(0,b.jsxs)(o.Ss,{className:"price-summary",children:[(0,b.jsx)(o.EY,{className:"summary-label",children:"\u8d77\u4ef7"}),(0,b.jsxs)(o.EY,{className:"summary-price",children:["\xa5",T.price]}),T.originalPrice&&T.originalPrice>T.price&&(0,b.jsxs)(o.EY,{className:"summary-original",children:["\xa5",T.originalPrice]})]}),(0,b.jsx)(o.Ss,{className:"btn-secondary",onTap:function(){return l().navigateBack()},children:(0,b.jsx)(o.EY,{children:"\u8fd4\u56de"})}),(0,b.jsx)(o.Ss,{className:"btn-primary",onTap:function(){return l().navigateTo({url:"/pages/product/index?id=".concat(T.id)})},children:(0,b.jsx)(o.EY,{children:"\u7acb\u5373\u5b9a\u5236"})})]}),(0,b.jsx)(o.Ss,{className:"safe-bottom-placeholder"})]}):(0,b.jsxs)(o.Ss,{className:"shop-detail-page theme-dark",children:[(0,b.jsx)(u.A,{darkTop:!0}),(0,b.jsx)(g.A,{title:"\u5546\u54c1\u8be6\u60c5",targetSelector:".shop-back-btn",showBack:!0}),(0,b.jsx)(o.Ss,{style:{padding:"40rpx"},onTap:_,children:(0,b.jsxs)(o.EY,{style:{color:"#fff"},children:[F||"\u5546\u54c1\u4e0d\u5b58\u5728","\uff0c\u70b9\u51fb\u91cd\u8bd5"]})})]})}var v={navigationStyle:"custom",enablePageMeta:!0,navigationBarTextStyle:"white"};Page((0,c.createPageConfig)(S,"pages/shop/detail/index",{root:{cn:[]}},v||{}))}},function(s){var e=function(e){return s(s.s=e)};s.O(0,[907,96,76],function(){return e(3483)});s.O()}]);