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