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.3 KiB
JavaScript
1 line
7.3 KiB
JavaScript
"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[612],{972:function(s,e,a){var c=a(5712),n=a(1393),r=a(9346),l=a(1433),i=a(408),t=a(3048),d=a.n(t),o=a(2785),m=a(8723),h=a(1679),x=a(1986),p=a(1872),u=a(4521),j=a(9093),N=a(2728),S=a(7396),f=a(846),g=a(2023),v=a(1070),E=a(6517);function Y(){var s=(0,x.wR)(),e=(s.theme,s.resolvedTheme),a=(0,p.c)();(0,u.l)(e);var c=(0,o.useState)(!1),t=(0,l.A)(c,2),Y=t[0],y=t[1],b=(0,o.useState)(1),k=(0,l.A)(b,2),w=k[0],T=k[1],A=d().getCurrentInstance().router,B=A?A.params:void 0,q=B&&B.id?B.id:"",P=(0,o.useState)((0,m.y9)(q)),C=(0,l.A)(P,2),F=C[0],I=C[1];if((0,o.useEffect)(function(){q&&(0,f.yj)(q).then(I).catch(function(){})},[q]),!F)return(0,E.jsxs)(i.Ss,{className:"theme-".concat(e),children:[(0,E.jsx)(j.A,{}),(0,E.jsx)(N.A,{title:"\u5546\u54c1\u8be6\u60c5",targetSelector:".page-header",showBack:!0}),(0,E.jsx)(i.Ss,{className:"product-page",children:(0,E.jsx)(i.Ss,{className:"page-header",style:{marginTop:"".concat(a.statusBarHeight+12,"px")},children:(0,E.jsxs)(i.Ss,{className:"page-header-inner",children:[(0,E.jsx)(i.Ss,{className:"back-btn",style:{position:"fixed",left:"30rpx",top:"".concat(a.menuButtonTop,"px"),zIndex:41},onTap:function(){return d().navigateBack()},children:(0,E.jsx)(i.EY,{className:"back-arrow",children:"\u2190"})}),(0,E.jsx)(i.Ss,{className:"nav-placeholder"}),(0,E.jsx)(i.EY,{className:"nav-title",children:"\u5546\u54c1\u672a\u627e\u5230"}),(0,E.jsx)(i.Ss,{className:"nav-placeholder"})]})})})]});var D=F.specs&&F.specs.length>0?F.specs.find(function(s){return s[0].indexOf("\u5de5\u827a")>=0}):void 0,M=D?D[1]:"\u6fc0\u5149\u5fae\u96d5",O=function(){T(1),y(!0)},Q=function(){var s=(0,r.A)((0,n.A)().m(function s(){var e,a;return(0,n.A)().w(function(s){while(1)switch(s.p=s.n){case 0:return e=(0,h.cY)(F,w),s.p=1,s.n=2,(0,g.x9)({productId:F.id,productName:F.name,unitPrice:F.price,count:w,designData:e.designData});case 2:a=s.v,(0,h.Fu)((0,h.p_)().map(function(s){return s.id===e.id?a:s})),s.n=4;break;case 3:s.p=3,s.v;case 4:y(!1),d().showToast({title:"\u5df2\u52a0\u5165\u8bbe\u8ba1\u6e05\u5355 x".concat(w),icon:"success"}),setTimeout(function(){return d().navigateBack()},1200);case 5:return s.a(2)}},s,null,[[1,3]])}));return function(){return s.apply(this,arguments)}}(),_=function(){d().navigateTo({url:"/pages/diy/index?source=product&productId=".concat(F.id,"&quantity=1")})},z=function(s){T(function(e){return Math.max(1,Math.min(99,e+s))})};return(0,E.jsxs)(i.Ss,{className:"theme-".concat(e),children:[(0,E.jsx)(j.A,{}),(0,E.jsx)(N.A,{title:"\u5546\u54c1\u8be6\u60c5",targetSelector:".page-header",showBack:!0}),(0,E.jsxs)(i.Ss,{className:"product-page",children:[(0,E.jsx)(i.Ss,{className:"page-header",style:{marginTop:"".concat(a.statusBarHeight+12,"px")},children:(0,E.jsxs)(i.Ss,{className:"page-header-inner",children:[(0,E.jsx)(i.Ss,{className:"back-btn",style:{position:"fixed",left:"30rpx",top:"".concat(a.menuButtonTop,"px"),zIndex:41},onTap:function(){return d().navigateBack()},children:(0,E.jsx)(i.EY,{className:"back-arrow",children:"\u2190"})}),(0,E.jsx)(i.Ss,{className:"nav-placeholder"}),(0,E.jsx)(i.EY,{className:"nav-title",children:"\u5546\u54c1\u8be6\u60c5"}),(0,E.jsx)(i.Ss,{className:"nav-placeholder"})]})}),(0,E.jsx)(i.Ss,{className:"hero-section",children:(0,E.jsx)(i.RC,{className:"hero-swiper",circular:!0,autoplay:!0,interval:3e3,duration:500,indicatorDots:!0,indicatorColor:"var(--border-strong)",indicatorActiveColor:"var(--accent-primary)",children:F.images&&F.images.length>0?F.images.map(function(s,e){return(0,E.jsx)(i.wu,{children:(0,E.jsx)(i.Ss,{className:"hero-block",children:(0,E.jsx)(v.A,{className:"hero-image",src:s,fallback:(0,m.QE)(F),mode:"aspectFill"})})},e)}):(0,E.jsx)(i.wu,{children:(0,E.jsx)(i.Ss,{className:"hero-block hero-block-fallback",children:(0,E.jsx)(i._V,{className:"hero-fallback-icon",src:(0,m.QE)(F),mode:"aspectFit"})})})})}),(0,E.jsx)(i.Ss,{className:"detail-card surface-card",children:(0,E.jsxs)(i.Ss,{className:"price-line",children:[(0,E.jsxs)(i.Ss,{className:"price-left",children:[(0,E.jsx)(i.EY,{className:"detail-title",children:F.name}),(0,E.jsx)(i.EY,{className:"detail-desc",children:F.desc})]}),(0,E.jsxs)(i.Ss,{className:"price-right",children:[(0,E.jsxs)(i.EY,{className:"price",children:["\xa5",F.price]}),F.originalPrice&&F.originalPrice>F.price&&(0,E.jsxs)(i.EY,{className:"price-old",children:["\xa5",F.originalPrice]})]})]})}),(0,E.jsxs)(i.Ss,{className:"detail-card surface-card",children:[(0,E.jsxs)(i.Ss,{className:"spec-row",children:[(0,E.jsx)(i.EY,{className:"spec-key",children:"\u5355\u4ef7"}),(0,E.jsxs)(i.EY,{className:"spec-value",children:["\xa5",F.price]})]}),(0,E.jsxs)(i.Ss,{className:"spec-row",children:[(0,E.jsx)(i.EY,{className:"spec-key",children:"\u5de5\u671f"}),(0,E.jsx)(i.EY,{className:"spec-value",children:F.leadTime})]}),(0,E.jsxs)(i.Ss,{className:"spec-row",children:[(0,E.jsx)(i.EY,{className:"spec-key",children:"\u5c3a\u5bf8"}),(0,E.jsxs)(i.EY,{className:"spec-value",children:[F.mask.width," \xd7 ",F.mask.height," px"]})]}),(0,E.jsxs)(i.Ss,{className:"spec-row",children:[(0,E.jsx)(i.EY,{className:"spec-key",children:"\u5b9a\u5236\u5de5\u827a"}),(0,E.jsx)(i.EY,{className:"spec-value",children:M})]})]}),(0,E.jsxs)(i.Ss,{className:"detail-card surface-card",children:[(0,E.jsx)(i.EY,{className:"section-title",children:"\u5546\u54c1\u4ecb\u7ecd"}),(0,E.jsx)(i.EY,{className:"detail-text",children:F.description})]}),(0,E.jsxs)(S.A,{children:[(0,E.jsxs)(i.Ss,{className:"price-summary",children:[(0,E.jsx)(i.EY,{className:"summary-label",children:"\u8d77\u4ef7"}),(0,E.jsxs)(i.EY,{className:"summary-price",children:["\xa5",F.price]})]}),(0,E.jsx)(i.Ss,{className:"btn-secondary",onTap:O,children:(0,E.jsx)(i.EY,{children:"\u52a0\u5165\u8bbe\u8ba1\u6e05\u5355"})}),(0,E.jsx)(i.Ss,{className:"btn-primary",onTap:_,children:(0,E.jsx)(i.EY,{children:"\u7acb\u5373\u4e0b\u5355"})})]}),Y&&(0,E.jsx)(i.Ss,{className:"modal-overlay",children:(0,E.jsxs)(i.Ss,{className:"modal-card surface-card",children:[(0,E.jsx)(i.EY,{className:"modal-title",children:"\u52a0\u5165\u8bbe\u8ba1\u6e05\u5355"}),(0,E.jsxs)(i.Ss,{className:"modal-product",children:[(0,E.jsx)(i._V,{className:"modal-icon-img",src:(0,m.QE)(F),mode:"aspectFit"}),(0,E.jsx)(i.EY,{className:"modal-name",children:F.name})]}),(0,E.jsxs)(i.Ss,{className:"quantity-row",children:[(0,E.jsx)(i.EY,{className:"qty-label",children:"\u6570\u91cf"}),(0,E.jsxs)(i.Ss,{className:"qty-control",children:[(0,E.jsx)(i.Ss,{className:"qty-btn",onTap:function(){return z(-1)},children:"\uff0d"}),(0,E.jsx)(i.EY,{className:"qty-num",children:w}),(0,E.jsx)(i.Ss,{className:"qty-btn",onTap:function(){return z(1)},children:"\uff0b"})]})]}),(0,E.jsxs)(i.Ss,{className:"modal-total",children:[(0,E.jsx)(i.EY,{className:"total-label",children:"\u5c0f\u8ba1"}),(0,E.jsxs)(i.EY,{className:"total-price",children:["\xa5",(F.price*w).toFixed(2)]})]}),(0,E.jsxs)(i.Ss,{className:"modal-actions",children:[(0,E.jsx)(i.Ss,{className:"btn-secondary",onTap:function(){return y(!1)},children:(0,E.jsx)(i.EY,{children:"\u53d6\u6d88"})}),(0,E.jsx)(i.Ss,{className:"btn-primary",onTap:Q,children:(0,E.jsx)(i.EY,{children:"\u786e\u5b9a"})})]})]})})]})]})}var y={navigationStyle:"custom",enablePageMeta:!0,navigationBarTitleText:"\u5546\u54c1\u8be6\u60c5"};Page((0,c.createPageConfig)(Y,"pages/product/index",{root:{cn:[]}},y||{}))}},function(s){var e=function(e){return s(s.s=e)};s.O(0,[907,96,76],function(){return e(972)});s.O()}]); |