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