8fdf0b1(R3) 基于 a13e380 却用旧工作区副本覆盖了 R2 域文件,导致终版
(feat/r1-catalog) 上 R2 功能丢失。本提交在不改动 R1/R3 域文件的前提下恢复:
- 整文件恢复(纯 R2 域):diy/index.tsx+scss(批次①②③全部修正)、
stickerEdit(批次③)、api/address.ts(region 转换收口)、
store/design.ts+address.ts(缓存层语义文档)、address 页(真机验收版)
- 手工合并:api/design.ts(R2 契约实现为基底 + R3 需要的 fetchDesign)、
types/index.ts(DesignDataV1.category 收窄 {id,mask,tone}、productIcon
optional、AddressItem.createdAt 恢复;保留 R1 ProductCategory 扩展与
R3 OrderItem 扩展)、designList 页(缓存优先 load + processing 徽标)
- 保留不动(其他链路域):checkout/orders/orderDetail/shop/index/profile、
api/order.ts、api/product.ts、productAdapter、request.ts(R3 构建期注入)、
keys.ts(R3 mock 处理)、product 页(R1 已实现等价服务端写入)
验证:build:weapp 通过;tsc 错误集合与恢复前对比,R1/R3 文件零变化。
Co-Authored-By: Claude <noreply@anthropic.com>
1 line
7.9 KiB
JavaScript
1 line
7.9 KiB
JavaScript
"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[158],{3545:function(s,e,c){var a=c(5712),n=c(6004),t=c(1433),r=c(408),o=c(3048),i=c.n(o),l=c(2785),h=c(8723),p=c(846),d=c(1872),u=c(4521),m=c(1986),x=c(9093),g=c(7396),j=c(1070),f=c(6517),N=function(s,e,c){return Math.min(Math.max(s,e),c)},b=function(s,e,c){return s+(e-s)*c},v=function(s){return 1-Math.pow(1-s,3)};function y(){var s=(0,m.wR)(),e=s.resolvedTheme,c=(0,l.useState)(667),a=(0,t.A)(c,2),o=a[0],y=a[1],S=(0,l.useState)(0),Y=(0,t.A)(S,2),E=Y[0],k=Y[1],w=(0,l.useRef)(0),T=(0,l.useRef)(null),P=(0,d.c)();(0,u.l)(e,{mode:"light"});var A=i().getCurrentInstance().router,C=A?A.params:void 0,O=C?C.id:"",M=(0,l.useMemo)(function(){return h.zv.find(function(s){return s.id===O})},[O]),I=(0,l.useState)(M),B=(0,t.A)(I,2),F=B[0],H=B[1];(0,l.useEffect)(function(){O&&(0,p.yj)(O).then(function(s){var e,c,a;H(M?(0,n.A)((0,n.A)((0,n.A)({},M),s),{},{description:s.description||M.description,story:s.story||M.story,scene:s.scene||M.scene,tags:null!==(e=s.tags)&&void 0!==e&&e.length?s.tags:M.tags,specs:null!==(c=s.specs)&&void 0!==c&&c.length?s.specs:M.specs,images:null!==(a=s.images)&&void 0!==a&&a.length?s.images:M.images}):s)}).catch(function(){return H(M)})},[M,O]),(0,l.useEffect)(function(){try{var s=i().getSystemInfoSync();y(s.windowHeight)}catch(s){}},[]);var R=(0,l.useCallback)(function(s){var e=s.detail&&s.detail.scrollTop||0;w.current=N(e/(1.2*o),0,1),null===T.current&&(T.current=setTimeout(function(){T.current=null,k(function(s){return Math.abs(s-w.current)<.002?s:w.current})},16))},[o]);(0,l.useEffect)(function(){return function(){null!==T.current&&clearTimeout(T.current)}},[]);var J=(0,l.useMemo)(function(){var s=E,e=0,c=0;if(s<=.4){var a=v(s/.4);e=b(0,32,a),c=b(0,38,a)}else if(s<=.55){var n=(s-.4)/.15;e=b(32,34,n),c=b(38,41,n)}else e=34,c=41;var t=s<=.4?0:s<=.7?b(0,-75,(s-.4)/.3):-75,r=s<=.35?1:s<=.48?N(1-(s-.35)/.13,0,1):0,o=s<=.55?0:s<=.7?(s-.55)/.15:1,i=s<=.05?0:s<=.22?v((s-.05)/.17):1,l=s<=.05?60:s<=.22?b(60,0,v((s-.05)/.17)):0;return{topCrop:e,bottomCrop:c,translateY:t,heroInfoOpacity:r,bandOpacity:o,contentOpacity:i,contentOffset:l,visibleHeight:100-e-c}},[E]),z=(0,l.useMemo)(function(){return F?F.tone:[28,22,18]},[F]),L=(null===F||void 0===F?void 0:F.description)||(null===F||void 0===F?void 0:F.subtitle)||(null===F||void 0===F?void 0:F.desc)||"",W=(0,l.useRef)(!1),q=function(){if(!W.current){W.current=!0;var s={url:"/pages/shop/index"};i().switchTab(s).catch(function(){return i().reLaunch(s)}).catch(function(){W.current=!1})}};return F?(0,f.jsxs)(r.Ss,{className:"shop-detail-page theme-dark",children:[(0,f.jsx)(x.A,{darkTop:!0}),(0,f.jsxs)(r.Ss,{className:"shop-hero-fixed",children:[(0,f.jsx)(r.Ss,{className:"shop-hero-clip",style:{height:"".concat(o*J.visibleHeight/100,"px"),overflow:"hidden",transform:"translateY(".concat(o*J.translateY/100,"px)")},children:(0,f.jsx)(j.A,{className:"shop-hero-img",src:F.images&&F.images[0]||F.iconImg||"",fallback:F.iconImg||F.icon,mode:"aspectFill",style:{width:"100%",height:"".concat(o,"px"),position:"absolute",top:"".concat(-o*J.topCrop/100,"px"),left:0}})}),(0,f.jsx)(r.Ss,{className:"shop-hero-overlay",style:{background:"linear-gradient(to bottom, rgba(".concat(z[0],", ").concat(z[1],", ").concat(z[2],", 0) 0%, rgba(").concat(z[0],", ").concat(z[1],", ").concat(z[2],", 0.55) 40%, rgba(").concat(z[0],", ").concat(z[1],", ").concat(z[2],", 0.95) 100%)")}}),(0,f.jsxs)(r.Ss,{className:"shop-hero-info",style:{opacity:J.heroInfoOpacity},children:[(0,f.jsx)(r.EY,{className:"shop-hero-title",children:F.name}),(0,f.jsx)(r.EY,{className:"shop-hero-subtitle",children:F.subtitle||F.desc}),(0,f.jsxs)(r.Ss,{className:"shop-hero-price-row",children:[(0,f.jsxs)(r.EY,{className:"shop-hero-price",children:["\xa5",F.price]}),F.originalPrice&&F.originalPrice>F.price&&(0,f.jsxs)(r.EY,{className:"shop-hero-original",children:["\xa5",F.originalPrice]})]})]})]}),(0,f.jsxs)(r.BM,{className:"shop-scroll",scrollY:!0,scrollEventThrottle:16,style:{height:"".concat(o,"px")},onScroll:R,children:[(0,f.jsx)(r.Ss,{style:{height:"".concat(.65*o,"px")}}),(0,f.jsxs)(r.Ss,{className:"shop-content",style:{backgroundColor:"rgb(".concat(z[0],", ").concat(z[1],", ").concat(z[2],")")},children:[(0,f.jsxs)(r.Ss,{className:"shop-band",style:{top:"".concat(P.statusBarHeight,"px"),opacity:J.bandOpacity,backgroundColor:"rgba(".concat(z[0],", ").concat(z[1],", ").concat(z[2],", 0.88)"),backdropFilter:"blur(12px)",WebkitBackdropFilter:"blur(12px)"},children:[(0,f.jsx)(r.EY,{className:"shop-band-title",children:F.name}),(0,f.jsx)(r.EY,{className:"shop-band-subtitle",children:F.subtitle||F.desc}),(0,f.jsxs)(r.Ss,{className:"shop-band-price-row",children:[(0,f.jsxs)(r.EY,{className:"shop-band-price",children:["\xa5",F.price]}),F.originalPrice&&F.originalPrice>F.price&&(0,f.jsxs)(r.EY,{className:"shop-band-original",children:["\xa5",F.originalPrice]})]})]}),(0,f.jsxs)(r.Ss,{className:"shop-detail-body",style:{opacity:J.contentOpacity,transform:"translateY(".concat(J.contentOffset,"px)")},children:[(0,f.jsxs)(r.Ss,{className:"shop-content-card",children:[(0,f.jsxs)(r.Ss,{className:"shop-section",children:[(0,f.jsx)(r.EY,{className:"shop-section-title",children:"\u5546\u54c1\u4ecb\u7ecd"}),(0,f.jsx)(r.EY,{className:"shop-section-text",children:L})]}),F.story&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(r.Ss,{className:"shop-divider"}),(0,f.jsxs)(r.Ss,{className:"shop-section",children:[(0,f.jsx)(r.EY,{className:"shop-section-title",children:"\u8bbe\u8ba1\u7406\u5ff5"}),(0,f.jsx)(r.EY,{className:"shop-section-text",children:F.story})]})]}),F.scene&&(0,f.jsx)(r.Ss,{className:"shop-divider"}),F.scene&&(0,f.jsxs)(r.Ss,{className:"shop-section",children:[(0,f.jsx)(r.EY,{className:"shop-section-title",children:"\u4f7f\u7528\u573a\u666f"}),(0,f.jsx)(r.EY,{className:"shop-section-text",children:F.scene})]}),F.tags&&F.tags.length>0&&(0,f.jsx)(r.Ss,{className:"shop-section",children:(0,f.jsx)(r.Ss,{className:"shop-tag-row",children:F.tags.map(function(s){return(0,f.jsx)(r.Ss,{className:"shop-tag",children:(0,f.jsx)(r.EY,{className:"shop-tag-text",children:s})},s)})})}),F.tags&&F.tags.length>0&&(0,f.jsx)(r.Ss,{className:"shop-divider"}),F.specs&&F.specs.length>0&&(0,f.jsx)(r.Ss,{className:"shop-divider"}),F.specs&&F.specs.length>0&&(0,f.jsxs)(r.Ss,{className:"shop-section",children:[(0,f.jsx)(r.EY,{className:"shop-section-title",children:"\u89c4\u683c\u53c2\u6570"}),(0,f.jsx)(r.Ss,{className:"shop-spec-table",children:F.specs.map(function(s){var e=(0,t.A)(s,2),c=e[0],a=e[1];return(0,f.jsxs)(r.Ss,{className:"shop-spec-row",children:[(0,f.jsx)(r.EY,{className:"shop-spec-key",children:c}),(0,f.jsx)(r.EY,{className:"shop-spec-val",children:a})]},c)})})]})]}),(0,f.jsx)(r.Ss,{className:"shop-bottom-spacer"})]})]})]},F.id),(0,f.jsx)(r.Ss,{className:"shop-back-btn",onTap:q,onClick:q,style:{top:"".concat(P.menuButtonTop,"px")},children:(0,f.jsx)(r.EY,{className:"shop-back-arrow",children:"\u2190"})}),(0,f.jsxs)(g.A,{children:[(0,f.jsxs)(r.Ss,{className:"price-summary",children:[(0,f.jsx)(r.EY,{className:"summary-label",children:"\u8d77\u4ef7"}),(0,f.jsxs)(r.EY,{className:"summary-price",children:["\xa5",F.price]}),F.originalPrice&&F.originalPrice>F.price&&(0,f.jsxs)(r.EY,{className:"summary-original",children:["\xa5",F.originalPrice]})]}),(0,f.jsx)(r.Ss,{className:"btn-secondary",onTap:q,onClick:q,children:(0,f.jsx)(r.EY,{children:"\u8fd4\u56de"})}),(0,f.jsx)(r.Ss,{className:"btn-primary",onTap:function(){return i().navigateTo({url:"/pages/product/index?id=".concat(F.id)})},children:(0,f.jsx)(r.EY,{children:"\u7acb\u5373\u5b9a\u5236"})})]}),(0,f.jsx)(r.Ss,{className:"safe-bottom-placeholder"})]}):(0,f.jsxs)(r.Ss,{className:"shop-detail-page theme-dark",children:[(0,f.jsx)(x.A,{darkTop:!0}),(0,f.jsx)(r.EY,{style:{color:"#fff",padding:"40rpx"},children:"\u5546\u54c1\u4e0d\u5b58\u5728"})]})}var S={navigationStyle:"custom",enablePageMeta:!0,navigationBarTextStyle:"white"};Page((0,a.createPageConfig)(y,"pages/shop/detail/index",{root:{cn:[]}},S||{}))}},function(s){var e=function(e){return s(s.s=e)};s.O(0,[907,96,76],function(){return e(3545)});s.O()}]); |