diff --git a/README.md b/README.md index c1090d3..509b4fa 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,18 @@ npm run dev:h5 - 小程序包体积长期保持 < 500KB; - 后续更换产品图只需在图床后台操作,无需重新发版。 +### 阿里云 OSS 实际操作 + +1. 在阿里云 OSS 创建 Bucket,建议区域选择离用户近的国内地域(如 `oss-cn-hangzhou`),读写权限选择**公共读**;如果后续要用于用户上传,再配置单独 Bucket 或后端预签名。 +2. 把 `src/img/` 上传到 Bucket 根目录 `img/`,把 `src/icon/` 上传到 Bucket 根目录 `icon/`(保持路径一致,前端无需改文件名)。 +3. 打开 `src/utils/asset.ts`,将 `ASSET_BASE_URL` 填成桶地址: + ```ts + export const ASSET_BASE_URL = 'https://your-bucket.oss-cn-hangzhou.aliyuncs.com' + ``` +4. 项目中商品图、首页成品图、商品 icon、设计清单/订单里已存的 icon 会自动拼接成远程 URL;本地路径作为兜底,后端没就绪时不裂图。 +5. 等 OSS 图片稳定后,可把 `config/index.js` 中 `src/img` 的 copy 规则移除,进一步压缩 dist 体积;`src/icon` 按需保留或也迁到 OSS。 +6. 微信小程序后台需要在「开发管理 - 服务器域名」配置 `downloadFile` 合法域名,且必须是 HTTPS。 + --- ## 最近更新记录(2026-08-06) @@ -307,7 +319,7 @@ npm run dev:h5 - [ ] 订单物流接口接入(目前为静态 mock) ### 中优先级 -- [ ] 将实物照片迁移到 CDN(腾讯云 COS / 阿里云 OSS) +- [ ] 上传商品图/icon 到阿里云 OSS,并填写 `ASSET_BASE_URL`(前端资源基址已接好) - [ ] 添加更多词云底图模板 - [ ] 支持从微信聊天记录导入 Excel 名单 - [ ] 实现设计稿保存到草稿箱功能 diff --git a/dist/common.js b/dist/common.js index 9a8d263..b3de541 100644 --- a/dist/common.js +++ b/dist/common.js @@ -1 +1 @@ -"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[76],{7723:function(n,t,e){e.d(t,{A:function(){return l}});var r=e(5544),o=e(758),i=e.n(o),c=e(6540),u=e(118),a=e(6764),d=e(9703),s=e(4848);function l(n){var t=(0,c.useState)("checking"),e=(0,r.A)(t,2),o=e[0],l=e[1],f=(0,c.useCallback)(function(){var n=!1;return(0,a.d)().then(function(t){n||l(t?"ok":"denied")}).catch(function(){n||l("denied")}),function(){n=!0}},[]);return(0,c.useEffect)(function(){var n=f(),t=function(){f()},e=function(){f()};return i().eventCenter.on("tabBarChange",t),i().eventCenter.on(d.Wo,e),i().eventCenter.on("authStateChanged",t),function(){n(),i().eventCenter.off("tabBarChange",t),i().eventCenter.off(d.Wo,e),i().eventCenter.off("authStateChanged",t)}},[f]),"checking"===o?(0,s.jsx)(u.Ss,{className:"login-guard",children:(0,s.jsxs)(u.Ss,{className:"login-guard-inner",children:[(0,s.jsx)(u.EY,{className:"login-guard-icon",children:"\u23f3"}),(0,s.jsx)(u.EY,{className:"login-guard-title",children:"\u6821\u9a8c\u767b\u5f55\u72b6\u6001"})]})}):"denied"===o?(0,s.jsx)(u.Ss,{className:"login-guard",children:(0,s.jsxs)(u.Ss,{className:"login-guard-inner",children:[(0,s.jsx)(u.EY,{className:"login-guard-icon",children:"\ud83d\udd12"}),(0,s.jsx)(u.EY,{className:"login-guard-title",children:"\u8bf7\u5148\u767b\u5f55"}),(0,s.jsx)(u.EY,{className:"login-guard-desc",children:"\u767b\u5f55\u540e\u67e5\u770b\u60a8\u7684\u4e13\u5c5e\u5185\u5bb9"}),(0,s.jsx)(u.Ss,{className:"btn-gradient login-guard-btn",onTap:function(){return i().switchTab({url:"/pages/profile/index"})},children:(0,s.jsx)(u.EY,{children:"\u53bb\u767b\u5f55"})})]})}):n.children}},9674:function(n,t,e){e.d(t,{A:function(){return c}});var r=e(118),o=e(9703),i=e(4848);function c(n){var t=n.darkTop,e=void 0!==t&&t,c=(0,o.wR)(),u=c.resolvedTheme,a="dark"===u||e,d=a?"#191919":"#ffffff",s=a?"#ffffff":"#000000";return(0,i.jsx)(r.tf,{backgroundColor:d,backgroundColorTop:d,backgroundColorBottom:d,backgroundTextStyle:a?"light":"dark",rootBackgroundColor:d,children:(0,i.jsx)(r.yk,{frontColor:s,backgroundColor:d})})}},9703:function(n,t,e){e.d(t,{NP:function(){return g},Wo:function(){return f},wR:function(){return h}});var r=e(5544),o=e(6540),i=e(758),c=e.n(i),u=e(118),a=e(8594),d=e(6606),s=e(4848),l=(0,o.createContext)({theme:"auto",resolvedTheme:"light",toggleTheme:function(){},setTheme:function(){}}),f="themeChange";function g(n){var t=n.children,e=(0,o.useState)((0,a.O4)()),g=(0,r.A)(e,2),h=g[0],p=g[1],m=(0,o.useState)((0,a.eW)((0,a.O4)())),v=(0,r.A)(m,2),S=v[0],y=v[1],k=(0,o.useCallback)(function(n){y((0,a.eW)(n))},[]),A=(0,o.useCallback)(function(n){(0,a.F0)(n),p(n),k(n)},[k]),b=(0,o.useCallback)(function(){var n="light"===S?"dark":"light";A(n)},[S,A]),C=(0,o.useCallback)(function(n){(0,a.Rq)(n),"auto"===(0,a.O4)()&&y(n)},[]),T=(0,o.useCallback)(function(){try{var n=c().getAppBaseInfo();C("dark"===n.theme?"dark":"light")}catch(n){}try{c().createSelectorQuery().select(".system-theme-detector").fields({computedStyle:["opacity"]}).exec(function(n){var t=n&&n[0]&&n[0].computedStyle&&n[0].computedStyle.opacity;C("1"===t?"dark":"light")})}catch(n){}},[C]);return(0,o.useEffect)(function(){T()},[T]),(0,o.useEffect)(function(){var n,t=function(n){!n||"dark"!==n.theme&&"light"!==n.theme||C(n.theme)},e=c();return null===(n=e.onThemeChange)||void 0===n||n.call(e,t),function(){var n;null===(n=e.offThemeChange)||void 0===n||n.call(e,t)}},[C]),(0,o.useEffect)(function(){c().eventCenter.trigger(f,S)},[S]),(0,o.useEffect)(function(){(0,d.G)(S)},[S]),(0,i.useDidShow)(function(){"auto"===h&&T()}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(u.Ss,{className:"system-theme-detector"}),(0,s.jsx)(l.Provider,{value:{theme:h,resolvedTheme:S,toggleTheme:b,setTheme:A},children:t})]})}function h(){return(0,o.useContext)(l)}},9201:function(n,t,e){e.d(t,{c:function(){return a}});var r=e(5544),o=e(6540),i=e(758),c=e.n(i),u=null;function a(){var n=(0,o.useState)(null!==u&&void 0!==u?u:{statusBarHeight:20,menuButtonTop:26,menuButtonHeight:32,capsuleRight:368,safeInsetTop:20,safeInsetBottom:0,headerPaddingTop:66,backBtnPaddingTop:20}),t=(0,r.A)(n,2),e=t[0],i=t[1];return(0,o.useEffect)(function(){if(u)i(u);else try{var n,t,e,r,o,a,d,s,l=c().getSystemInfoSync(),f=c().getMenuButtonBoundingClientRect(),g=l.statusBarHeight||20,h=null!==(n=f.top)&&void 0!==n?n:g+4,p=null!==(t=f.height)&&void 0!==t?t:32,m=null!==(e=f.right)&&void 0!==e?e:l.windowWidth-7,v=null!==(r=null===(o=l.safeArea)||void 0===o?void 0:o.top)&&void 0!==r?r:g,S=null!==(a=l.safeAreaInsetBottom)&&void 0!==a?a:l.screenHeight-(null!==(d=null===(s=l.safeArea)||void 0===s?void 0:s.bottom)&&void 0!==d?d:l.screenHeight),y=Math.max(h+p+6,g+44),k=Math.max(g,h-4),A={statusBarHeight:g,menuButtonTop:h,menuButtonHeight:p,capsuleRight:m,safeInsetTop:v,safeInsetBottom:S,headerPaddingTop:y,backBtnPaddingTop:k};u=A,i(A)}catch(n){}},[]),e}},5414:function(n,t,e){e.d(t,{l:function(){return u}});var r=e(6540),o=e(758),i=e.n(o),c=e(6606);function u(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.mode,u=void 0===e?"auto":e,a=(0,r.useCallback)(function(){var t="dark"===u||"auto"===u&&"light"===n,e=t?"#000000":"#ffffff",r=t?"#ffffff":"#191919";i().setNavigationBarColor({frontColor:e,backgroundColor:r}),(0,c.G)(n,r)},[u,n]);(0,r.useEffect)(a,[a]),(0,o.useDidShow)(a)}},6295:function(n,t,e){e.d(t,{gf:function(){return i.gf},iD:function(){return c},jp:function(){return l},r7:function(){return a},ri:function(){return s}});var r=e(1212),o=e(467),i=e(3246);function c(n){return u.apply(this,arguments)}function u(){return u=(0,o.A)((0,r.A)().m(function n(t){var e;return(0,r.A)().w(function(n){while(1)switch(n.n){case 0:return n.n=1,i.Ay.post("/api/auth/login",{code:t},{auth:!1});case 1:return e=n.v,null!==e&&void 0!==e&&e.accessToken&&(0,i.WG)(e.accessToken),n.a(2,e)}},n)})),u.apply(this,arguments)}function a(n){return d.apply(this,arguments)}function d(){return d=(0,o.A)((0,r.A)().m(function n(t){return(0,r.A)().w(function(n){while(1)switch(n.n){case 0:return n.a(2,i.Ay.patch("/api/users/me",t))}},n)})),d.apply(this,arguments)}function s(){(0,i.L)()}function l(){return f.apply(this,arguments)}function f(){return f=(0,o.A)((0,r.A)().m(function n(){return(0,r.A)().w(function(n){while(1)switch(n.n){case 0:return n.a(2,i.Ay.get("/api/users/me"))}},n)})),f.apply(this,arguments)}},6764:function(n,t,e){e.d(t,{d:function(){return S},m:function(){return h}});var r=e(1212),o=e(467),i=e(2284),c=e(758),u=e.n(c),a=e(6295),d=e(8594),s="smart_auth_verified",l=18e5,f=null,g=null;function h(){f=null,g=null;try{u().removeStorageSync(s)}catch(n){}}function p(n){var t=f||function(){try{var n=u().getStorageSync(s);return n&&"object"===(0,i.A)(n)?n:null}catch(n){return null}}();return t&&t.openid===n?Date.now()-t.at>l?null:(f=t,t.ok):null}function m(n,t){var e={openid:n,ok:t,at:Date.now()};f=e;try{u().setStorageSync(s,e)}catch(n){}}function v(){var n=(0,d.Q4)();return!(null===n||void 0===n||!n.openid)&&!(0,d.Ic)(n.openid)&&!!n.accessToken&&!!(0,a.gf)()}function S(){return y.apply(this,arguments)}function y(){return y=(0,o.A)((0,r.A)().m(function n(){var t,e;return(0,r.A)().w(function(n){while(1)switch(n.n){case 0:if(t=(0,d.Q4)(),null!==t&&void 0!==t&&t.openid){n.n=1;break}return console.log("[AuthGuard] \u65e0\u672c\u5730\u7528\u6237\uff0c\u5224\u5b9a\u672a\u767b\u5f55"),n.a(2,!1);case 1:if(console.log("[AuthGuard] \u672c\u5730\u7528\u6237 openid=",t.openid),!(0,d.Ic)(t.openid)){n.n=2;break}return(0,d.Hf)(),(0,a.ri)(),h(),n.a(2,!1);case 2:if(e=p(t.openid),null===e){n.n=3;break}return console.log("[AuthGuard] \u547d\u4e2d\u672c\u5730\u7f13\u5b58 ok=",e),n.a(2,e);case 3:return g||(g=(0,a.jp)().then(function(n){console.log("[AuthGuard] getMe \u8fd4\u56de:",JSON.stringify(n));var e=!!n&&!!n.id&&n.openid===t.openid;return console.log("[AuthGuard] \u4e00\u81f4\u6027=",e),e?(m(t.openid,!0),!0):((0,d.Hf)(),(0,a.ri)(),h(),!1)}).catch(function(n){return console.error("[AuthGuard] getMe \u5931\u8d25\uff0c\u8d70\u672c\u5730\u4f1a\u8bdd\u515c\u5e95:",n),v()}).finally(function(){g=null})),n.a(2,g)}},n)})),y.apply(this,arguments)}},5234:function(n,t,e){e.d(t,{QE:function(){return u},R6:function(){return o},rj:function(){return c},y9:function(){return i},zv:function(){return r}});var r=[{id:"notebook-small",name:"\u5fae\u96d5\u7b14\u8bb0\u672c\uff08\u5c0f\uff09",desc:"\u4fbf\u643a\u968f\u884c\uff0c\u8bb0\u5f55\u70b9\u6ef4",icon:"\ud83d\udcd3",iconImg:"/icon/\u4e66\u672c.png",price:12,originalPrice:18,leadTime:"3-5\u4e2a\u5de5\u4f5c\u65e5",description:"\u7cbe\u9009\u4f18\u8d28\u7eb8\u5f20\uff0c\u5c01\u9762\u91c7\u7528\u9ad8\u6863PU\u6750\u8d28\uff0c\u624b\u611f\u7ec6\u817b\u3002\u5185\u9875\u53ef\u5b9a\u5236\u6a2a\u7ebf\u3001\u65b9\u683c\u6216\u7a7a\u767d\u4e09\u79cd\u7248\u5f0f\u3002\u6fc0\u5149\u5fae\u96d5\u5de5\u827a\u5c06\u540d\u5b57\u6216\u56fe\u6848\u7cbe\u51c6\u523b\u5370\u5728\u5c01\u9762\uff0c\u6c38\u4e0d\u892a\u8272\u3002\u5c0f\u5de7\u8f7b\u4fbf\uff0c\u9002\u5408\u968f\u8eab\u643a\u5e26\uff0c\u65e0\u8bba\u662f\u8bfe\u5802\u7b14\u8bb0\u8fd8\u662f\u65e5\u5e38\u5907\u5fd8\uff0c\u90fd\u662f\u4f60\u7684\u4e13\u5c5e\u4f34\u4fa3\u3002",subtitle:"\u638c\u5fc3\u95f4\u7684\u4e13\u5c5e\u5370\u8bb0 \xb7 \u6fc0\u5149\u5fae\u96d5 \xb7 \u4e09\u8272\u5185\u9875\u53ef\u9009",tone:[28,22,18],story:"\u7075\u611f\u6e90\u81ea\u624b\u8d26\u6587\u5316\u4e2d\u5bf9\u4e66\u5199\u4eea\u5f0f\u611f\u7684\u8ffd\u6c42\u3002\u6211\u4eec\u76f8\u4fe1\uff0c\u5728\u6570\u5b57\u6d2a\u6d41\u7684\u65f6\u4ee3\uff0c\u7eb8\u7b14\u7684\u6e29\u5ea6\u4f9d\u7136\u4e0d\u53ef\u66ff\u4ee3\u3002\u5f53\u6fc0\u5149\u5fae\u96d5\u5728PU\u5c01\u9762\u4e0a\u7559\u4e0b\u4e13\u5c5e\u5370\u8bb0\uff0c\u6bcf\u4e00\u7b14\u4e66\u5199\u90fd\u5728\u4e0e\u8fc7\u53bb\u5bf9\u8bdd\u3002\u7b14\u8bb0\u672c\u5c0f\u5de7\u5230\u8db3\u4ee5\u653e\u5165\u4efb\u4f55\u53e3\u888b\uff0c\u5374\u627f\u8f7d\u7740\u72ec\u4e00\u65e0\u4e8c\u7684\u8bb0\u5fc6\u3002",scene:"\u8bfe\u5802\u7b14\u8bb0\u3001\u65e5\u5e38\u5907\u5fd8\u3001\u65c5\u884c\u624b\u8d26\u3001\u5fc3\u60c5\u65e5\u8bb0\u3002\u9002\u5408\u9001\u7ed9\u540c\u5b66\u3001\u4f34\u4fa3\u6216\u4f5c\u4e3a\u6d3b\u52a8\u4f34\u624b\u793c\u2014\u2014\u8ba9\u6bcf\u4e00\u4e2a\u4eba\u90fd\u62e5\u6709\u523b\u7740\u81ea\u5df1\u540d\u5b57\u7684\u4e13\u5c5e\u7b14\u8bb0\u672c\u3002",tags:["\u4f34\u624b\u793c","\u5b66\u751f","\u624b\u8d26","\u4fbf\u643a","\u6fc0\u5149\u5fae\u96d5"],specs:[["\u5c3a\u5bf8","105 \xd7 148mm\uff08A6\uff09"],["\u9875\u6570","120\u5f20/240\u9875"],["\u5185\u9875\u7248\u5f0f","\u6a2a\u7ebf / \u65b9\u683c / \u7a7a\u767d \u53ef\u9009"],["\u5c01\u9762\u6750\u8d28","\u9ad8\u6863PU\u76ae\u9769"],["\u96d5\u523b\u5de5\u827a","CO2 \u6fc0\u5149\u5fae\u96d5\uff08\u6c38\u4e0d\u892a\u8272\uff09"],["\u9002\u7528\u573a\u666f","\u8bfe\u5802\u3001\u65c5\u884c\u3001\u65e5\u5e38\u5907\u5fd8"]],images:["/img/book_small/The1.jpg"],mask:{shape:"rect",width:300,height:420,borderRadius:8}},{id:"notebook-large",name:"\u5fae\u96d5\u7b14\u8bb0\u672c\uff08\u5927\uff09",desc:"\u5927\u5f00\u672c\uff0c\u66f4\u591a\u521b\u4f5c\u7a7a\u95f4",icon:"\ud83d\udcd4",iconImg:"/icon/\u4e66\u672c_\u5927.png",price:45,originalPrice:58,leadTime:"3-5\u4e2a\u5de5\u4f5c\u65e5",description:"A4\u5c3a\u5bf8\u5927\u5f00\u672c\uff0c180\xb0\u5e73\u644a\u8bbe\u8ba1\uff0c\u4e66\u5199\u66f4\u81ea\u7531\u3002\u5c01\u9762\u53ef\u9009\u771f\u76ae\u3001\u4eff\u5e03\u7eb9\u6216\u78e8\u7802\u6750\u8d28\uff0c\u6fc0\u5149\u5fae\u96d5\u533a\u57df\u66f4\u5927\uff0c\u9002\u5408\u5448\u73b0\u5168\u73ed\u540d\u5b57\u3001\u56e2\u961f\u53e3\u53f7\u6216\u516c\u53f8Logo\u7b49\u5927\u7bc7\u5e45\u5185\u5bb9\u3002\u662f\u6bd5\u4e1a\u7eaa\u5ff5\u3001\u4f01\u4e1a\u5e74\u4f1a\u793c\u54c1\u7684\u9996\u9009\u3002",subtitle:"\u5927\u7bc7\u5e45\u5b9a\u5236\u9996\u9009 \xb7 180\xb0\u5e73\u644a \xb7 \u6bd5\u4e1a/\u56e2\u5efa\u5fc5\u5907",tone:[35,28,22],story:"\u6bcf\u4e00\u6b21\u544a\u522b\u90fd\u503c\u5f97\u88ab\u90d1\u91cd\u4e66\u5199\u3002\u6bd5\u4e1a\u5b63\u7684\u6559\u5ba4\u91cc\uff0c\u7b14\u8bb0\u672c\u644a\u5f00\u5728\u8bfe\u684c\u4e0a\uff0c\u5168\u73ed\u7684\u540d\u5b57\u88ab\u6fc0\u5149\u523b\u5370\u5728\u5c01\u9762\u4e2d\u592e\uff0c\u6210\u4e3a\u6c38\u6052\u7684\u540c\u5b66\u5f55\u3002180\xb0\u5e73\u644a\u8bbe\u8ba1\u8ba9\u4e66\u5199\u4e0d\u518d\u88ab\u8ba2\u88c5\u675f\u7f1a\uff0cA4\u5927\u5c3a\u5bf8\u7ed9\u4f60\u5c3d\u60c5\u6325\u6d12\u7684\u5929\u5730\u3002\u8fd9\u662f\u9001\u7ed9\u4e00\u7fa4\u4eba\u6700\u597d\u7684\u544a\u522b\u793c\u7269\u3002",scene:"\u6bd5\u4e1a\u7eaa\u5ff5\u518c\u3001\u516c\u53f8\u5e74\u4f1a\u793c\u54c1\u3001\u56e2\u961f\u5efa\u8bbe\u4f34\u624b\u793c\u3001\u5ba2\u6237\u7b54\u8c22\u3002\u7279\u522b\u9002\u5408\u9700\u8981\u5728\u5c01\u9762\u5448\u73b0\u5927\u91cf\u6587\u5b57\u6216\u56fe\u6848\u7684\u5b9a\u5236\u9700\u6c42\u2014\u2014\u73ed\u7ea7\u540d\u5355\u3001\u516c\u53f8\u613f\u666f\u3001\u56e2\u961f\u53e3\u53f7\u4e00\u7f51\u6253\u5c3d\u3002",tags:["\u6bd5\u4e1a\u793c","\u56e2\u5efa","\u4f01\u4e1a\u5b9a\u5236","\u5927\u7bc7\u5e45","\u5e73\u644a\u8bbe\u8ba1"],specs:[["\u5c3a\u5bf8","210 \xd7 297mm\uff08A4\uff09"],["\u9875\u6570","100\u5f20/200\u9875"],["\u5c01\u9762\u6750\u8d28","\u771f\u76ae / \u4eff\u5e03\u7eb9 / \u78e8\u7802 \u53ef\u9009"],["\u5f00\u5408\u9002\u7528","180\xb0\u5e73\u644a\u8bbe\u8ba1"],["\u96d5\u523b\u5de5\u827a","CO2 \u6fc0\u5149\u5fae\u96d5\uff08\u9ad8\u6e05\u6670\u5ea6\uff09"],["\u5b9a\u5236\u9762\u79ef","\u5c01\u9762\u6574\u9762\u53ef\u96d5"]],images:["/img/book_big/The1.jpg","/img/book_big/The2.jpg"],mask:{shape:"rect",width:340,height:480,borderRadius:8}},{id:"coaster",name:"\u94dc\u8d28\u676f\u57ab",desc:"\u91d1\u5c5e\u8d28\u611f\uff0c\u684c\u9762\u827a\u672f",icon:"\u2615",iconImg:"/icon/\u676f\u5b50.png",price:25,originalPrice:35,leadTime:"5-7\u4e2a\u5de5\u4f5c\u65e5",description:"\u91c7\u7528\u4f18\u8d28\u9ec4\u94dc\u6750\u8d28\uff0c\u8868\u9762\u7ecf\u62c9\u4e1d\u5de5\u827a\u5904\u7406\uff0c\u5448\u73b0\u54d1\u5149\u91d1\u5c5e\u8d28\u611f\u3002\u80cc\u9762\u914d\u6709\u9632\u6ed1\u8f6f\u6728\u57ab\uff0c\u4fdd\u62a4\u684c\u9762\u540c\u65f6\u9632\u6b62\u6ed1\u52a8\u3002\u6fc0\u5149\u5fae\u96d5\u53ef\u5728\u8868\u9762\u523b\u5370\u540d\u5b57\u3001\u65e5\u671f\u6216\u795d\u798f\u8bed\uff0c\u662f\u4e54\u8fc1\u65b0\u5c45\u3001\u65b0\u5a5a\u8d3a\u793c\u7684\u7cbe\u81f4\u4e4b\u9009\u3002",subtitle:"\u9ec4\u94dc\u8d28\u611f \xb7 \u62c9\u4e1d\u54d1\u5149 \xb7 \u684c\u9762\u4e0a\u7684\u5fae\u578b\u96d5\u5851",tone:[42,30,18],story:"\u8bbe\u8ba1\u7075\u611f\u6765\u81ea\u65e5\u5f0f\u4f98\u5bc2\u7f8e\u5b66\u3002\u5c81\u6708\u4f1a\u5728\u9ec4\u94dc\u8868\u9762\u7559\u4e0b\u6e29\u67d4\u7684\u6c27\u5316\u75d5\u8ff9\uff0c\u5c31\u5982\u540c\u4e00\u676f\u8336\u4ece\u70ed\u5230\u51c9\u7684\u8fc7\u7a0b\u3002\u62c9\u4e1d\u5904\u7406\u540e\u7684\u54d1\u5149\u8868\u9762\u5728\u706f\u5149\u4e0b\u5448\u73b0\u7ec6\u817b\u7684\u91d1\u5c5e\u7eb9\u7406\uff0c\u6fc0\u5149\u5fae\u96d5\u7684\u540d\u5b57\u6210\u4e3a\u8fd9\u4ef6\u5668\u7269\u4e0a\u6700\u51b7\u9759\u7684\u6ce8\u811a\u3002\u5b83\u4e0d\u53ea\u662f\u676f\u57ab\uff0c\u66f4\u662f\u684c\u9762\u4e0a\u7684\u5fae\u578b\u96d5\u5851\u3002",scene:"\u4e54\u8fc1\u9001\u793c\u3001\u65b0\u5a5a\u8d3a\u793c\u3001\u5496\u5561\u89d2\u5e03\u7f6e\u3001\u529e\u516c\u684c\u7f8e\u5b66\u3002\u9002\u5408\u9001\u7ed9\u559c\u6b22\u624b\u51b2\u5496\u5561\u7684\u670b\u53cb\uff0c\u6216\u4f5c\u4e3a\u5a5a\u793c\u5bbe\u5ba2\u7684\u56de\u793c\u2014\u2014\u6bcf\u4e00\u53ea\u676f\u57ab\u4e0a\u90fd\u523b\u7740\u5bbe\u5ba2\u7684\u540d\u5b57\uff0c\u8ba9\u793c\u7269\u672c\u8eab\u6210\u4e3a\u5ea7\u4f4d\u5361\u3002",tags:["\u4e54\u8fc1\u793c","\u65b0\u5a5a\u8d3a\u793c","\u684c\u9762\u7f8e\u5b66","\u9ec4\u94dc","\u624b\u51b2\u5496\u5561"],specs:[["\u6750\u8d28","\u9ec4\u94dc + \u80cc\u9762\u8f6f\u6728\u9632\u6ed1\u57ab"],["\u8868\u9762\u5904\u7406","\u62c9\u4e1d\u54d1\u5149"],["\u76f4\u5f84","100mm"],["\u539a\u5ea6","3mm"],["\u96d5\u523b\u5de5\u827a","\u5149\u7ea4\u6fc0\u5149\u7cbe\u7ec6\u5fae\u96d5"],["\u8010\u6e29","\u2264120\xb0C"]],images:["/img/cup/The1.jpg"],mask:{shape:"circle",width:280,height:280}},{id:"penbox",name:"\u7af9\u5236\u7b14\u76d2",desc:"\u81ea\u7136\u7af9\u7eb9\uff0c\u6587\u623f\u96c5\u5668",icon:"\u270f\ufe0f",iconImg:"/icon/\u7b14\u76d2.png",price:75,originalPrice:98,leadTime:"7-10\u4e2a\u5de5\u4f5c\u65e5",description:"\u7cbe\u9009\u5929\u7136\u6960\u7af9\uff0c\u7ecf\u591a\u9053\u5de5\u5e8f\u6253\u78e8\u629b\u5149\uff0c\u4fdd\u7559\u5929\u7136\u7af9\u7eb9\u808c\u7406\u3002\u76d2\u76d6\u91c7\u7528\u78c1\u5438\u5f00\u5408\uff0c\u5185\u90e8\u8bbe\u6709\u5206\u5c42\u9694\u677f\u3002\u6fc0\u5149\u5fae\u96d5\u5728\u7af9\u9762\u4e0a\u5448\u73b0\u6df1\u6d45\u4e0d\u4e00\u7684\u96d5\u523b\u6548\u679c\uff0c\u878d\u5165\u58a8\u9999\u6c14\u8d28\u3002\u9002\u5408\u4e66\u623f\u6848\u5934\u3001\u4e66\u6cd5\u7231\u597d\u8005\u7684\u6587\u623f\u4f34\u4fa3\u3002",subtitle:"\u5929\u7136\u6960\u7af9 \xb7 \u78c1\u5438\u5f00\u5408 \xb7 \u6587\u623f\u96c5\u5668\u4e4b\u9009",tone:[30,24,16],story:"\u6bcf\u4e00\u53ea\u7b14\u76d2\u90fd\u6765\u81ea\u540c\u4e00\u7247\u7af9\u6797\u7684\u4e0d\u540c\u90e8\u4f4d\uff0c\u56e0\u6b64\u7eb9\u8def\u7edd\u4e0d\u91cd\u590d\u2014\u2014\u6b63\u5982\u6ca1\u6709\u4e24\u4e2a\u4eba\u7684\u4e66\u6cd5\u98ce\u683c\u5b8c\u5168\u76f8\u540c\u3002\u6211\u4eec\u4fdd\u7559\u4e86\u6960\u7af9\u5929\u7136\u7684\u6e29\u6da6\u89e6\u611f\uff0c\u53ea\u5728\u8868\u9762\u4ee5\u6fc0\u5149\u523b\u4e0b\u540d\u5b57\u6216\u4e00\u53e5\u7bb4\u8a00\u3002\u6253\u5f00\u78c1\u5438\u76d2\u76d6\u65f6\u7684\u6e05\u8106\u58f0\u54cd\uff0c\u662f\u6587\u623f\u4e2d\u7684\u5c0f\u5c0f\u4eea\u5f0f\u3002",scene:"\u4e66\u623f\u6848\u5934\u3001\u4e66\u6cd5\u7231\u597d\u8005\u88c5\u5907\u3001\u6559\u5e08\u8282\u793c\u7269\u3001\u4e66\u623f\u6696\u623f\u793c\u3002\u9002\u5408\u9001\u7ed9\u5199\u5b57\u597d\u770b\u7684\u4eba\u2014\u2014\u56e0\u4e3a\u61c2\u4e66\u5199\u7684\u4eba\uff0c\u624d\u61c2\u4e00\u53ea\u597d\u7b14\u76d2\u7684\u5206\u91cf\u3002",tags:["\u6587\u623f","\u4e66\u6cd5","\u6559\u5e08\u8282","\u4e66\u623f","\u5929\u7136\u6750\u8d28"],specs:[["\u6750\u8d28","\u5929\u7136\u6960\u7af9"],["\u5f00\u5408\u65b9\u5f0f","\u78c1\u5438\u5f0f\u76d2\u76d6"],["\u5185\u90e8\u7ed3\u6784","\u5206\u5c42\u9694\u677f\uff08\u53ef\u8c03\u8282\uff09"],["\u5c3a\u5bf8","200 \xd7 65 \xd7 30mm"],["\u8868\u9762\u5904\u7406","\u624b\u5de5\u6253\u78e8\u629b\u5149\uff0c\u65e0\u6f06"],["\u96d5\u523b\u5de5\u827a","CO2 \u6fc0\u5149\u70e7\u8680\uff08\u6df1\u6d45\u53ef\u8c03\uff09"]],images:["/img/penbox/The1.jpg","/img/penbox/The2.jpg","/img/penbox/The3.jpg"],mask:{shape:"rect",width:320,height:160,borderRadius:12}},{id:"booklamp",name:"\u4e66\u672c\u578b\u706f",desc:"\u6e29\u6696\u5149\u5f71\uff0c\u70b9\u4eae\u5fc3\u610f",icon:"\ud83d\udca1",iconImg:"/icon/\u4e66\u706f.png",price:45,originalPrice:68,leadTime:"5-7\u4e2a\u5de5\u4f5c\u65e5",description:"\u5f00\u5408\u5f0f\u8bbe\u8ba1\uff0c\u6253\u5f00\u5373\u4eae\uff0c\u5408\u62e2\u5373\u706d\uff0c\u5982\u9b54\u6cd5\u4e66\u822c\u5145\u6ee1\u60ca\u559c\u3002\u91c7\u7528LED\u6696\u5149\u706f\u6e90\uff0c\u5149\u7ebf\u67d4\u548c\u4e0d\u523a\u773c\uff0c\u53ef\u6301\u7eed\u70b9\u4eae6-8\u5c0f\u65f6\u3002\u5c01\u9762\u6fc0\u5149\u5fae\u96d5\u53ef\u5b9a\u5236\u6587\u5b57\u3001\u56fe\u6848\u6216\u7167\u7247\uff0c\u8ba9\u6e29\u6696\u7684\u706f\u5149\u627f\u8f7d\u4e13\u5c5e\u8bb0\u5fc6\u3002\u662f\u60c5\u4fa3\u793c\u7269\u3001\u6bd5\u4e1a\u793c\u7269\u7684\u521b\u610f\u4e4b\u9009\u3002",subtitle:"\u5f00\u5408\u5373\u4eae \xb7 LED\u6696\u5149 \xb7 \u9b54\u6cd5\u4e66\u822c\u7684\u60ca\u559c",tone:[25,20,15],story:"\u7075\u611f\u6765\u81ea\u300a\u54c8\u5229\xb7\u6ce2\u7279\u300b\u4e2d\u7684\u9b54\u6cd5\u8bfe\u672c\u2014\u2014\u6253\u5f00\u4e00\u672c\u4e66\uff0c\u5149\u8292\u503e\u6cfb\u800c\u51fa\u3002\u6211\u4eec\u91c7\u7528\u675c\u90a6\u7eb8\u4e0e\u5b9e\u6728\u5c01\u9762\u7ed3\u5408\uff0c\u8ba9\u706f\u4f53\u65e2\u8f7b\u8584\u53c8\u575a\u56fa\u3002\u6fc0\u5149\u5fae\u96d5\u5728\u5c01\u9762\u7559\u4e0b\u4f60\u7684\u540d\u5b57\u6216\u4e00\u5e45\u5c0f\u753b\uff0c\u5f53\u706f\u5728\u6df1\u591c\u4eae\u8d77\uff0c\u90a3\u662f\u4e13\u5c5e\u4e8e\u4f60\u7684\u6e29\u6696\u89d2\u843d\u3002",scene:"\u60c5\u4fa3\u793c\u7269\u3001\u6bd5\u4e1a\u7eaa\u5ff5\u3001\u5e8a\u5934\u591c\u706f\u3001\u9732\u8425\u6c1b\u56f4\u706f\u3001\u513f\u7ae5\u623f\u3002\u7279\u522b\u9002\u5408\u5728\u5c01\u9762\u523b\u4e0a\u4e24\u4e2a\u4eba\u7684\u540d\u5b57\u548c\u4e00\u53e5\u60c5\u8bdd\uff0c\u5728\u60c5\u4eba\u8282\u6216\u7eaa\u5ff5\u65e5\u9001\u51fa\u2014\u2014\u6253\u5f00\u4e66\u706f\uff0c\u5c31\u50cf\u6253\u5f00\u4e00\u5c01\u4f1a\u53d1\u5149\u7684\u60c5\u4e66\u3002",tags:["\u60c5\u4fa3\u793c","\u6bd5\u4e1a\u7eaa\u5ff5","\u591c\u706f","\u6c1b\u56f4\u706f","\u521b\u610f\u793c\u7269"],specs:[["\u5149\u6e90","LED \u6696\u767d\u5149\uff083000K\uff09"],["\u7eed\u822a","6-8\u5c0f\u65f6\uff08\u5185\u7f6e\u53ef\u5145\u7535\u9502\u7535\u6c60\uff09"],["\u5145\u7535","USB Type-C \u63a5\u53e3"],["\u5c01\u9762\u6750\u8d28","\u675c\u90a6\u7eb8 + \u5b9e\u6728\u5c01\u9762"],["\u5c55\u5f00\u5c3a\u5bf8","210 \xd7 150mm"],["\u96d5\u523b\u5de5\u827a","\u6fc0\u5149\u5fae\u96d5\uff08\u652f\u6301\u6587\u5b57+\u7b80\u5355\u56fe\u6848\uff09"]],images:["/img/booklight/The1.jpg","/img/booklight/The2.jpg"],mask:{shape:"rect",width:320,height:240,borderRadius:4}}],o=r,i=function(n){return r.find(function(t){return t.id===n})},c={"notebook-small":"/icon/\u4e66\u672c.png","notebook-large":"/icon/\u4e66\u672c_\u5927.png",coaster:"/icon/\u676f\u5b50.png",penbox:"/icon/\u7b14\u76d2.png",booklamp:"/icon/\u4e66\u706f.png"};function u(n){return null!==n&&void 0!==n&&n.iconImg?n.iconImg:null!==n&&void 0!==n&&n.id&&c[n.id]||"/icon/\u56db\u89d2\u661f.png"}},3246:function(n,t,e){e.d(t,{L:function(){return g},Sy:function(){return s},WG:function(){return f},gf:function(){return l}});var r=e(1212),o=e(9379),i=e(467),c=e(758),u=e.n(c),a="https://wxbackend.tokenleaping.com",d="smart_access_token";function s(){try{u().hideLoading()}catch(n){}}function l(){try{return u().getStorageSync(d)||""}catch(n){return""}}function f(n){u().setStorageSync(d,n)}function g(){try{u().removeStorageSync(d)}catch(n){}}function h(n){return p.apply(this,arguments)}function p(){return p=(0,i.A)((0,r.A)().m(function n(t){var e,i,c,d,s,f,h,p,v,S,y,k,A,b=arguments;return(0,r.A)().w(function(n){while(1)switch(n.p=n.n){case 0:return e=b.length>1&&void 0!==b[1]?b[1]:{},i=e.method,c=void 0===i?"GET":i,d=e.data,s=e.headers,f=void 0===s?{}:s,h=e.auth,p=void 0===h||h,v=l(),S=(0,o.A)((0,o.A)({"Content-Type":"application/json"},p&&v?{Authorization:"Bearer ".concat(v)}:{}),f),n.p=1,n.n=2,u().request({url:"".concat(a).concat(t),method:c,data:d,header:S});case 2:y=n.v,n.n=4;break;case 3:throw n.p=3,n.v,new Error("\u7f51\u7edc\u5f02\u5e38\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5");case 4:if(401!==y.statusCode){n.n=5;break}throw g(),null===(k=m)||void 0===k||k(),new Error("\u767b\u5f55\u5df2\u8fc7\u671f\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55");case 5:if(A=y.data,!A||"number"!==typeof A.code||0===A.code){n.n=6;break}throw new Error(A.message||"\u8bf7\u6c42\u5931\u8d25");case 6:return n.a(2,A&&"number"===typeof A.code?A.data:A)}},n,null,[[1,3]])})),p.apply(this,arguments)}var m=null;var v={get:function(n,t){return h(n,(0,o.A)((0,o.A)({},t),{},{method:"GET"}))},post:function(n,t,e){return h(n,(0,o.A)((0,o.A)({},e),{},{method:"POST",data:t}))},put:function(n,t,e){return h(n,(0,o.A)((0,o.A)({},e),{},{method:"PUT",data:t}))},patch:function(n,t,e){return h(n,(0,o.A)((0,o.A)({},e),{},{method:"PATCH",data:t}))},del:function(n,t){return h(n,(0,o.A)((0,o.A)({},t),{},{method:"DELETE"}))}};t.Ay=v},8594:function(n,t,e){e.d(t,{E1:function(){return K},EB:function(){return X},F0:function(){return F},Fu:function(){return G},Hf:function(){return C},IU:function(){return L},Ic:function(){return f},O4:function(){return Y},Q1:function(){return _},Q4:function(){return k},Re:function(){return q},Rq:function(){return Q},ab:function(){return V},cY:function(){return R},eW:function(){return z},hG:function(){return I},i5:function(){return W},iA:function(){return T},iZ:function(){return j},kg:function(){return x},kh:function(){return H},n7:function(){return O},p_:function(){return P},uF:function(){return E},ug:function(){return w},yU:function(){return Z}});var r=e(9379),o=e(436),i=e(758),c=e.n(i),u=e(5234),a=e(6764),d="smart_theme",s="smart_user_info",l="smart_active_openid";function f(n){return!!n&&(n.startsWith("mock_")||n.startsWith("mock-"))}function g(){var n=k(),t=(null===n||void 0===n?void 0:n.openid)||c().getStorageSync(l)||"_guest_";return c().setStorageSync(l,t),t}function h(n){var t=g();return"".concat(n,"_").concat(t)}var p="smart_user_registry",m="zhihui2024";function v(){try{return c().getStorageSync(p)||[]}catch(n){return[]}}function S(n){var t=v();t.includes(n)||(t.push(n),c().setStorageSync(p,t))}function y(n){var t=v().filter(function(t){return t!==n});c().setStorageSync(p,t)}function k(){try{return c().getStorageSync(s)}catch(n){return null}}function A(n){var t;c().setStorageSync(s,n),null!==n&&void 0!==n&&n.openid&&(c().setStorageSync(l,n.openid),c().setStorageSync("user_info_".concat(n.openid),n),S(n.openid)),(0,a.m)(),null===(t=c().eventCenter)||void 0===t||t.trigger("authStateChanged",{openid:(null===n||void 0===n?void 0:n.openid)||""})}function b(n){try{var t=c().getStorageSync("user_info_".concat(n));if(t)return t}catch(n){}var e=k();return(null===e||void 0===e?void 0:e.openid)===n?e:null}function C(){var n;c().removeStorageSync(s),c().removeStorageSync(l),(0,a.m)(),null===(n=c().eventCenter)||void 0===n||n.trigger("authStateChanged",{openid:""})}function T(n){A(n)}function w(){return k()}function _(){var n=v();return n.map(function(n){var t=b(n),e=D(n),r=N(n);return{openid:n,nickName:(null===t||void 0===t?void 0:t.nickName)||"\u672a\u77e5\u7528\u6237",avatarUrl:(null===t||void 0===t?void 0:t.avatarUrl)||"",loginAt:(null===t||void 0===t?void 0:t.loginAt)||0,designCount:e.length,orderCount:r.length}})}function x(n,t){var e="mock_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,6),r={openid:e,nickName:n||"\u5fae\u4fe1\u7528\u6237",avatarUrl:t||"",loginAt:Date.now()};return A(r),r}function j(n){var t=b(n);return!!t&&(c().setStorageSync(s,t),c().setStorageSync(l,n),!0)}function I(n){c().removeStorageSync("user_info_".concat(n)),c().removeStorageSync("design_list_".concat(n)),c().removeStorageSync("order_list_".concat(n)),c().removeStorageSync("address_list_".concat(n)),y(n);var t=k();(null===t||void 0===t?void 0:t.openid)===n&&C()}function E(n){return n===m}function B(n,t){return"".concat(n,"_").concat(t)}function D(n){try{return c().getStorageSync(B("design_list",n))||[]}catch(n){return[]}}function N(n){try{return c().getStorageSync(B("order_list",n))||[]}catch(n){return[]}}function P(){try{return c().getStorageSync(h("design_list"))||[]}catch(n){return[]}}function G(n){c().setStorageSync(h("design_list"),n)}function R(n,t){var e=P(),r=(null===n||void 0===n?void 0:n.iconImg)||u.rj[null===n||void 0===n?void 0:n.id]||"/icon/\u56db\u89d2\u661f.png",i={id:"DSG"+Date.now(),productId:n.id,productName:n.name,productIcon:r,unitPrice:n.price,count:t,status:"undesigned",createdAt:(new Date).toISOString().slice(0,10)};return G([].concat((0,o.A)(e),[i])),i}function W(n,t){var e=P(),o=e.findIndex(function(t){return t.id===n});-1!==o&&(e[o]=(0,r.A)((0,r.A)({},e[o]),t),G(e))}function H(n){var t=P().filter(function(t){return!n.includes(t.id)});G(t)}function O(){try{return c().getStorageSync(h("order_list"))||[]}catch(n){return[]}}function U(n){c().setStorageSync(h("order_list"),n)}function L(n){var t,e=P(),r=O(),i=e.find(function(t){return t.id===n});if(!i)return null;var c=null!==(t=i.productIcon)&&void 0!==t&&t.startsWith("/icon/")?i.productIcon:u.rj[i.productId]||"/icon/\u56db\u89d2\u661f.png",a={id:"ORD"+Date.now().toString().slice(-9),productName:i.productName,productIcon:c,statusCode:"pending",date:(new Date).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).replace(/\//g,"-"),price:"\xa5"+(i.unitPrice*i.count).toFixed(2),count:i.count,sku:"".concat(i.productName," \xd7 ").concat(i.count)},d=e.findIndex(function(t){return t.id===n});return-1!==d&&(e[d].status="ordered",e[d].orderId=a.id),G(e),U([a].concat((0,o.A)(r))),a}function Y(){try{return c().getStorageSync(d)||"auto"}catch(n){return"auto"}}function F(n){c().setStorageSync(d,n)}var M=null;function Q(n){M=n}function z(n){if("auto"===n){if(M)return M;try{var t=c().getAppBaseInfo();if("dark"===t.theme||"light"===t.theme)return t.theme}catch(n){}return"light"}return n}function q(){try{return c().getStorageSync(h("address_list"))||[]}catch(n){return[]}}function J(n){c().setStorageSync(h("address_list"),n)}function K(n){var t=q(),e=(0,r.A)((0,r.A)({},n),{},{id:"ADR"+Date.now()});return e.isDefault&&t.forEach(function(n){n.isDefault=!1}),J([e].concat((0,o.A)(t))),e}function Z(n,t){var e=q(),o=e.findIndex(function(t){return t.id===n});-1!==o&&(t.isDefault&&e.forEach(function(n){n.isDefault=!1}),e[o]=(0,r.A)((0,r.A)({},e[o]),t),J(e))}function V(n){var t=q().filter(function(t){return t.id!==n});J(t)}function X(){return q().find(function(n){return n.isDefault})}},6606:function(n,t,e){e.d(t,{G:function(){return c}});var r=e(758),o=e.n(r);function i(n){return"dark"===n?"#191919":"#ffffff"}function c(n,t){var e=null!==t&&void 0!==t?t:i(n);o().setBackgroundColor({backgroundColor:e,backgroundColorTop:e,backgroundColorBottom:e}),o().setBackgroundTextStyle({textStyle:"dark"===n?"light":"dark"})}}}]); \ No newline at end of file +"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[76],{7723:function(n,t,e){e.d(t,{A:function(){return f}});var r=e(5544),o=e(758),i=e.n(o),u=e(6540),c=e(118),a=e(6764),s=e(9703),d=e(4848);function f(n){var t=(0,u.useState)("checking"),e=(0,r.A)(t,2),o=e[0],f=e[1],l=(0,u.useCallback)(function(){var n=!1;return(0,a.d)().then(function(t){n||f(t?"ok":"denied")}).catch(function(){n||f("denied")}),function(){n=!0}},[]);return(0,u.useEffect)(function(){var n=l(),t=function(){l()},e=function(){l()};return i().eventCenter.on("tabBarChange",t),i().eventCenter.on(s.Wo,e),i().eventCenter.on("authStateChanged",t),function(){n(),i().eventCenter.off("tabBarChange",t),i().eventCenter.off(s.Wo,e),i().eventCenter.off("authStateChanged",t)}},[l]),"checking"===o?(0,d.jsx)(c.Ss,{className:"login-guard",children:(0,d.jsxs)(c.Ss,{className:"login-guard-inner",children:[(0,d.jsx)(c.EY,{className:"login-guard-icon",children:"\u23f3"}),(0,d.jsx)(c.EY,{className:"login-guard-title",children:"\u6821\u9a8c\u767b\u5f55\u72b6\u6001"})]})}):"denied"===o?(0,d.jsx)(c.Ss,{className:"login-guard",children:(0,d.jsxs)(c.Ss,{className:"login-guard-inner",children:[(0,d.jsx)(c.EY,{className:"login-guard-icon",children:"\ud83d\udd12"}),(0,d.jsx)(c.EY,{className:"login-guard-title",children:"\u8bf7\u5148\u767b\u5f55"}),(0,d.jsx)(c.EY,{className:"login-guard-desc",children:"\u767b\u5f55\u540e\u67e5\u770b\u60a8\u7684\u4e13\u5c5e\u5185\u5bb9"}),(0,d.jsx)(c.Ss,{className:"btn-gradient login-guard-btn",onTap:function(){return i().switchTab({url:"/pages/profile/index"})},children:(0,d.jsx)(c.EY,{children:"\u53bb\u767b\u5f55"})})]})}):n.children}},9674:function(n,t,e){e.d(t,{A:function(){return u}});var r=e(118),o=e(9703),i=e(4848);function u(n){var t=n.darkTop,e=void 0!==t&&t,u=(0,o.wR)(),c=u.resolvedTheme,a="dark"===c||e,s=a?"#191919":"#ffffff",d=a?"#ffffff":"#000000";return(0,i.jsx)(r.tf,{backgroundColor:s,backgroundColorTop:s,backgroundColorBottom:s,backgroundTextStyle:a?"light":"dark",rootBackgroundColor:s,children:(0,i.jsx)(r.yk,{frontColor:d,backgroundColor:s})})}},9703:function(n,t,e){e.d(t,{NP:function(){return g},Wo:function(){return l},wR:function(){return h}});var r=e(5544),o=e(6540),i=e(758),u=e.n(i),c=e(118),a=e(8594),s=e(6606),d=e(4848),f=(0,o.createContext)({theme:"auto",resolvedTheme:"light",toggleTheme:function(){},setTheme:function(){}}),l="themeChange";function g(n){var t=n.children,e=(0,o.useState)((0,a.O4)()),g=(0,r.A)(e,2),h=g[0],p=g[1],m=(0,o.useState)((0,a.eW)((0,a.O4)())),v=(0,r.A)(m,2),S=v[0],y=v[1],k=(0,o.useCallback)(function(n){y((0,a.eW)(n))},[]),A=(0,o.useCallback)(function(n){(0,a.F0)(n),p(n),k(n)},[k]),b=(0,o.useCallback)(function(){var n="light"===S?"dark":"light";A(n)},[S,A]),C=(0,o.useCallback)(function(n){(0,a.Rq)(n),"auto"===(0,a.O4)()&&y(n)},[]),T=(0,o.useCallback)(function(){try{var n=u().getAppBaseInfo();C("dark"===n.theme?"dark":"light")}catch(n){}try{u().createSelectorQuery().select(".system-theme-detector").fields({computedStyle:["opacity"]}).exec(function(n){var t=n&&n[0]&&n[0].computedStyle&&n[0].computedStyle.opacity;C("1"===t?"dark":"light")})}catch(n){}},[C]);return(0,o.useEffect)(function(){T()},[T]),(0,o.useEffect)(function(){var n,t=function(n){!n||"dark"!==n.theme&&"light"!==n.theme||C(n.theme)},e=u();return null===(n=e.onThemeChange)||void 0===n||n.call(e,t),function(){var n;null===(n=e.offThemeChange)||void 0===n||n.call(e,t)}},[C]),(0,o.useEffect)(function(){u().eventCenter.trigger(l,S)},[S]),(0,o.useEffect)(function(){(0,s.G)(S)},[S]),(0,i.useDidShow)(function(){"auto"===h&&T()}),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(c.Ss,{className:"system-theme-detector"}),(0,d.jsx)(f.Provider,{value:{theme:h,resolvedTheme:S,toggleTheme:b,setTheme:A},children:t})]})}function h(){return(0,o.useContext)(f)}},9201:function(n,t,e){e.d(t,{c:function(){return a}});var r=e(5544),o=e(6540),i=e(758),u=e.n(i),c=null;function a(){var n=(0,o.useState)(null!==c&&void 0!==c?c:{statusBarHeight:20,menuButtonTop:26,menuButtonHeight:32,capsuleRight:368,safeInsetTop:20,safeInsetBottom:0,headerPaddingTop:66,backBtnPaddingTop:20}),t=(0,r.A)(n,2),e=t[0],i=t[1];return(0,o.useEffect)(function(){if(c)i(c);else try{var n,t,e,r,o,a,s,d,f=u().getSystemInfoSync(),l=u().getMenuButtonBoundingClientRect(),g=f.statusBarHeight||20,h=null!==(n=l.top)&&void 0!==n?n:g+4,p=null!==(t=l.height)&&void 0!==t?t:32,m=null!==(e=l.right)&&void 0!==e?e:f.windowWidth-7,v=null!==(r=null===(o=f.safeArea)||void 0===o?void 0:o.top)&&void 0!==r?r:g,S=null!==(a=f.safeAreaInsetBottom)&&void 0!==a?a:f.screenHeight-(null!==(s=null===(d=f.safeArea)||void 0===d?void 0:d.bottom)&&void 0!==s?s:f.screenHeight),y=Math.max(h+p+6,g+44),k=Math.max(g,h-4),A={statusBarHeight:g,menuButtonTop:h,menuButtonHeight:p,capsuleRight:m,safeInsetTop:v,safeInsetBottom:S,headerPaddingTop:y,backBtnPaddingTop:k};c=A,i(A)}catch(n){}},[]),e}},5414:function(n,t,e){e.d(t,{l:function(){return c}});var r=e(6540),o=e(758),i=e.n(o),u=e(6606);function c(n){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=t.mode,c=void 0===e?"auto":e,a=(0,r.useCallback)(function(){var t="dark"===c||"auto"===c&&"light"===n,e=t?"#000000":"#ffffff",r=t?"#ffffff":"#191919";i().setNavigationBarColor({frontColor:e,backgroundColor:r}),(0,u.G)(n,r)},[c,n]);(0,r.useEffect)(a,[a]),(0,o.useDidShow)(a)}},6295:function(n,t,e){e.d(t,{gf:function(){return i.gf},iD:function(){return u},jp:function(){return f},r7:function(){return a},ri:function(){return d}});var r=e(1212),o=e(467),i=e(3246);function u(n){return c.apply(this,arguments)}function c(){return c=(0,o.A)((0,r.A)().m(function n(t){var e;return(0,r.A)().w(function(n){while(1)switch(n.n){case 0:return n.n=1,i.Ay.post("/api/auth/login",{code:t},{auth:!1});case 1:return e=n.v,null!==e&&void 0!==e&&e.accessToken&&(0,i.WG)(e.accessToken),n.a(2,e)}},n)})),c.apply(this,arguments)}function a(n){return s.apply(this,arguments)}function s(){return s=(0,o.A)((0,r.A)().m(function n(t){return(0,r.A)().w(function(n){while(1)switch(n.n){case 0:return n.a(2,i.Ay.patch("/api/users/me",t))}},n)})),s.apply(this,arguments)}function d(){(0,i.L)()}function f(){return l.apply(this,arguments)}function l(){return l=(0,o.A)((0,r.A)().m(function n(){return(0,r.A)().w(function(n){while(1)switch(n.n){case 0:return n.a(2,i.Ay.get("/api/users/me"))}},n)})),l.apply(this,arguments)}},8199:function(n,t,e){e.d(t,{uq:function(){return o}});var r="";function o(n){if(!n)return"";if(/^(https?:|wxfile:|data:)/i.test(n))return n;if(!r)return n;var t=r.replace(/\/+$/,""),e=n.startsWith("/")?n:"/".concat(n);return"".concat(t).concat(e)}},6764:function(n,t,e){e.d(t,{d:function(){return S},m:function(){return h}});var r=e(1212),o=e(467),i=e(2284),u=e(758),c=e.n(u),a=e(6295),s=e(8594),d="smart_auth_verified",f=18e5,l=null,g=null;function h(){l=null,g=null;try{c().removeStorageSync(d)}catch(n){}}function p(n){var t=l||function(){try{var n=c().getStorageSync(d);return n&&"object"===(0,i.A)(n)?n:null}catch(n){return null}}();return t&&t.openid===n?Date.now()-t.at>f?null:(l=t,t.ok):null}function m(n,t){var e={openid:n,ok:t,at:Date.now()};l=e;try{c().setStorageSync(d,e)}catch(n){}}function v(){var n=(0,s.Q4)();return!(null===n||void 0===n||!n.openid)&&!(0,s.Ic)(n.openid)&&!!n.accessToken&&!!(0,a.gf)()}function S(){return y.apply(this,arguments)}function y(){return y=(0,o.A)((0,r.A)().m(function n(){var t,e;return(0,r.A)().w(function(n){while(1)switch(n.n){case 0:if(t=(0,s.Q4)(),null!==t&&void 0!==t&&t.openid){n.n=1;break}return console.log("[AuthGuard] \u65e0\u672c\u5730\u7528\u6237\uff0c\u5224\u5b9a\u672a\u767b\u5f55"),n.a(2,!1);case 1:if(console.log("[AuthGuard] \u672c\u5730\u7528\u6237 openid=",t.openid),!(0,s.Ic)(t.openid)){n.n=2;break}return(0,s.Hf)(),(0,a.ri)(),h(),n.a(2,!1);case 2:if(e=p(t.openid),null===e){n.n=3;break}return console.log("[AuthGuard] \u547d\u4e2d\u672c\u5730\u7f13\u5b58 ok=",e),n.a(2,e);case 3:return g||(g=(0,a.jp)().then(function(n){console.log("[AuthGuard] getMe \u8fd4\u56de:",JSON.stringify(n));var e=!!n&&!!n.id&&n.openid===t.openid;return console.log("[AuthGuard] \u4e00\u81f4\u6027=",e),e?(m(t.openid,!0),!0):((0,s.Hf)(),(0,a.ri)(),h(),!1)}).catch(function(n){return console.error("[AuthGuard] getMe \u5931\u8d25\uff0c\u8d70\u672c\u5730\u4f1a\u8bdd\u515c\u5e95:",n),v()}).finally(function(){g=null})),n.a(2,g)}},n)})),y.apply(this,arguments)}},5234:function(n,t,e){e.d(t,{QE:function(){return d},R6:function(){return c},rj:function(){return s},y9:function(){return a},zv:function(){return u}});var r=e(9379),o=e(8199),i=[{id:"notebook-small",name:"\u5fae\u96d5\u7b14\u8bb0\u672c\uff08\u5c0f\uff09",desc:"\u4fbf\u643a\u968f\u884c\uff0c\u8bb0\u5f55\u70b9\u6ef4",icon:"\ud83d\udcd3",iconImg:"/icon/\u4e66\u672c.png",price:12,originalPrice:18,leadTime:"3-5\u4e2a\u5de5\u4f5c\u65e5",description:"\u7cbe\u9009\u4f18\u8d28\u7eb8\u5f20\uff0c\u5c01\u9762\u91c7\u7528\u9ad8\u6863PU\u6750\u8d28\uff0c\u624b\u611f\u7ec6\u817b\u3002\u5185\u9875\u53ef\u5b9a\u5236\u6a2a\u7ebf\u3001\u65b9\u683c\u6216\u7a7a\u767d\u4e09\u79cd\u7248\u5f0f\u3002\u6fc0\u5149\u5fae\u96d5\u5de5\u827a\u5c06\u540d\u5b57\u6216\u56fe\u6848\u7cbe\u51c6\u523b\u5370\u5728\u5c01\u9762\uff0c\u6c38\u4e0d\u892a\u8272\u3002\u5c0f\u5de7\u8f7b\u4fbf\uff0c\u9002\u5408\u968f\u8eab\u643a\u5e26\uff0c\u65e0\u8bba\u662f\u8bfe\u5802\u7b14\u8bb0\u8fd8\u662f\u65e5\u5e38\u5907\u5fd8\uff0c\u90fd\u662f\u4f60\u7684\u4e13\u5c5e\u4f34\u4fa3\u3002",subtitle:"\u638c\u5fc3\u95f4\u7684\u4e13\u5c5e\u5370\u8bb0 \xb7 \u6fc0\u5149\u5fae\u96d5 \xb7 \u4e09\u8272\u5185\u9875\u53ef\u9009",tone:[28,22,18],story:"\u7075\u611f\u6e90\u81ea\u624b\u8d26\u6587\u5316\u4e2d\u5bf9\u4e66\u5199\u4eea\u5f0f\u611f\u7684\u8ffd\u6c42\u3002\u6211\u4eec\u76f8\u4fe1\uff0c\u5728\u6570\u5b57\u6d2a\u6d41\u7684\u65f6\u4ee3\uff0c\u7eb8\u7b14\u7684\u6e29\u5ea6\u4f9d\u7136\u4e0d\u53ef\u66ff\u4ee3\u3002\u5f53\u6fc0\u5149\u5fae\u96d5\u5728PU\u5c01\u9762\u4e0a\u7559\u4e0b\u4e13\u5c5e\u5370\u8bb0\uff0c\u6bcf\u4e00\u7b14\u4e66\u5199\u90fd\u5728\u4e0e\u8fc7\u53bb\u5bf9\u8bdd\u3002\u7b14\u8bb0\u672c\u5c0f\u5de7\u5230\u8db3\u4ee5\u653e\u5165\u4efb\u4f55\u53e3\u888b\uff0c\u5374\u627f\u8f7d\u7740\u72ec\u4e00\u65e0\u4e8c\u7684\u8bb0\u5fc6\u3002",scene:"\u8bfe\u5802\u7b14\u8bb0\u3001\u65e5\u5e38\u5907\u5fd8\u3001\u65c5\u884c\u624b\u8d26\u3001\u5fc3\u60c5\u65e5\u8bb0\u3002\u9002\u5408\u9001\u7ed9\u540c\u5b66\u3001\u4f34\u4fa3\u6216\u4f5c\u4e3a\u6d3b\u52a8\u4f34\u624b\u793c\u2014\u2014\u8ba9\u6bcf\u4e00\u4e2a\u4eba\u90fd\u62e5\u6709\u523b\u7740\u81ea\u5df1\u540d\u5b57\u7684\u4e13\u5c5e\u7b14\u8bb0\u672c\u3002",tags:["\u4f34\u624b\u793c","\u5b66\u751f","\u624b\u8d26","\u4fbf\u643a","\u6fc0\u5149\u5fae\u96d5"],specs:[["\u5c3a\u5bf8","105 \xd7 148mm\uff08A6\uff09"],["\u9875\u6570","120\u5f20/240\u9875"],["\u5185\u9875\u7248\u5f0f","\u6a2a\u7ebf / \u65b9\u683c / \u7a7a\u767d \u53ef\u9009"],["\u5c01\u9762\u6750\u8d28","\u9ad8\u6863PU\u76ae\u9769"],["\u96d5\u523b\u5de5\u827a","CO2 \u6fc0\u5149\u5fae\u96d5\uff08\u6c38\u4e0d\u892a\u8272\uff09"],["\u9002\u7528\u573a\u666f","\u8bfe\u5802\u3001\u65c5\u884c\u3001\u65e5\u5e38\u5907\u5fd8"]],images:["/img/book_small/The1.jpg"],mask:{shape:"rect",width:300,height:420,borderRadius:8}},{id:"notebook-large",name:"\u5fae\u96d5\u7b14\u8bb0\u672c\uff08\u5927\uff09",desc:"\u5927\u5f00\u672c\uff0c\u66f4\u591a\u521b\u4f5c\u7a7a\u95f4",icon:"\ud83d\udcd4",iconImg:"/icon/\u4e66\u672c_\u5927.png",price:45,originalPrice:58,leadTime:"3-5\u4e2a\u5de5\u4f5c\u65e5",description:"A4\u5c3a\u5bf8\u5927\u5f00\u672c\uff0c180\xb0\u5e73\u644a\u8bbe\u8ba1\uff0c\u4e66\u5199\u66f4\u81ea\u7531\u3002\u5c01\u9762\u53ef\u9009\u771f\u76ae\u3001\u4eff\u5e03\u7eb9\u6216\u78e8\u7802\u6750\u8d28\uff0c\u6fc0\u5149\u5fae\u96d5\u533a\u57df\u66f4\u5927\uff0c\u9002\u5408\u5448\u73b0\u5168\u73ed\u540d\u5b57\u3001\u56e2\u961f\u53e3\u53f7\u6216\u516c\u53f8Logo\u7b49\u5927\u7bc7\u5e45\u5185\u5bb9\u3002\u662f\u6bd5\u4e1a\u7eaa\u5ff5\u3001\u4f01\u4e1a\u5e74\u4f1a\u793c\u54c1\u7684\u9996\u9009\u3002",subtitle:"\u5927\u7bc7\u5e45\u5b9a\u5236\u9996\u9009 \xb7 180\xb0\u5e73\u644a \xb7 \u6bd5\u4e1a/\u56e2\u5efa\u5fc5\u5907",tone:[35,28,22],story:"\u6bcf\u4e00\u6b21\u544a\u522b\u90fd\u503c\u5f97\u88ab\u90d1\u91cd\u4e66\u5199\u3002\u6bd5\u4e1a\u5b63\u7684\u6559\u5ba4\u91cc\uff0c\u7b14\u8bb0\u672c\u644a\u5f00\u5728\u8bfe\u684c\u4e0a\uff0c\u5168\u73ed\u7684\u540d\u5b57\u88ab\u6fc0\u5149\u523b\u5370\u5728\u5c01\u9762\u4e2d\u592e\uff0c\u6210\u4e3a\u6c38\u6052\u7684\u540c\u5b66\u5f55\u3002180\xb0\u5e73\u644a\u8bbe\u8ba1\u8ba9\u4e66\u5199\u4e0d\u518d\u88ab\u8ba2\u88c5\u675f\u7f1a\uff0cA4\u5927\u5c3a\u5bf8\u7ed9\u4f60\u5c3d\u60c5\u6325\u6d12\u7684\u5929\u5730\u3002\u8fd9\u662f\u9001\u7ed9\u4e00\u7fa4\u4eba\u6700\u597d\u7684\u544a\u522b\u793c\u7269\u3002",scene:"\u6bd5\u4e1a\u7eaa\u5ff5\u518c\u3001\u516c\u53f8\u5e74\u4f1a\u793c\u54c1\u3001\u56e2\u961f\u5efa\u8bbe\u4f34\u624b\u793c\u3001\u5ba2\u6237\u7b54\u8c22\u3002\u7279\u522b\u9002\u5408\u9700\u8981\u5728\u5c01\u9762\u5448\u73b0\u5927\u91cf\u6587\u5b57\u6216\u56fe\u6848\u7684\u5b9a\u5236\u9700\u6c42\u2014\u2014\u73ed\u7ea7\u540d\u5355\u3001\u516c\u53f8\u613f\u666f\u3001\u56e2\u961f\u53e3\u53f7\u4e00\u7f51\u6253\u5c3d\u3002",tags:["\u6bd5\u4e1a\u793c","\u56e2\u5efa","\u4f01\u4e1a\u5b9a\u5236","\u5927\u7bc7\u5e45","\u5e73\u644a\u8bbe\u8ba1"],specs:[["\u5c3a\u5bf8","210 \xd7 297mm\uff08A4\uff09"],["\u9875\u6570","100\u5f20/200\u9875"],["\u5c01\u9762\u6750\u8d28","\u771f\u76ae / \u4eff\u5e03\u7eb9 / \u78e8\u7802 \u53ef\u9009"],["\u5f00\u5408\u9002\u7528","180\xb0\u5e73\u644a\u8bbe\u8ba1"],["\u96d5\u523b\u5de5\u827a","CO2 \u6fc0\u5149\u5fae\u96d5\uff08\u9ad8\u6e05\u6670\u5ea6\uff09"],["\u5b9a\u5236\u9762\u79ef","\u5c01\u9762\u6574\u9762\u53ef\u96d5"]],images:["/img/book_big/The1.jpg","/img/book_big/The2.jpg"],mask:{shape:"rect",width:340,height:480,borderRadius:8}},{id:"coaster",name:"\u94dc\u8d28\u676f\u57ab",desc:"\u91d1\u5c5e\u8d28\u611f\uff0c\u684c\u9762\u827a\u672f",icon:"\u2615",iconImg:"/icon/\u676f\u5b50.png",price:25,originalPrice:35,leadTime:"5-7\u4e2a\u5de5\u4f5c\u65e5",description:"\u91c7\u7528\u4f18\u8d28\u9ec4\u94dc\u6750\u8d28\uff0c\u8868\u9762\u7ecf\u62c9\u4e1d\u5de5\u827a\u5904\u7406\uff0c\u5448\u73b0\u54d1\u5149\u91d1\u5c5e\u8d28\u611f\u3002\u80cc\u9762\u914d\u6709\u9632\u6ed1\u8f6f\u6728\u57ab\uff0c\u4fdd\u62a4\u684c\u9762\u540c\u65f6\u9632\u6b62\u6ed1\u52a8\u3002\u6fc0\u5149\u5fae\u96d5\u53ef\u5728\u8868\u9762\u523b\u5370\u540d\u5b57\u3001\u65e5\u671f\u6216\u795d\u798f\u8bed\uff0c\u662f\u4e54\u8fc1\u65b0\u5c45\u3001\u65b0\u5a5a\u8d3a\u793c\u7684\u7cbe\u81f4\u4e4b\u9009\u3002",subtitle:"\u9ec4\u94dc\u8d28\u611f \xb7 \u62c9\u4e1d\u54d1\u5149 \xb7 \u684c\u9762\u4e0a\u7684\u5fae\u578b\u96d5\u5851",tone:[42,30,18],story:"\u8bbe\u8ba1\u7075\u611f\u6765\u81ea\u65e5\u5f0f\u4f98\u5bc2\u7f8e\u5b66\u3002\u5c81\u6708\u4f1a\u5728\u9ec4\u94dc\u8868\u9762\u7559\u4e0b\u6e29\u67d4\u7684\u6c27\u5316\u75d5\u8ff9\uff0c\u5c31\u5982\u540c\u4e00\u676f\u8336\u4ece\u70ed\u5230\u51c9\u7684\u8fc7\u7a0b\u3002\u62c9\u4e1d\u5904\u7406\u540e\u7684\u54d1\u5149\u8868\u9762\u5728\u706f\u5149\u4e0b\u5448\u73b0\u7ec6\u817b\u7684\u91d1\u5c5e\u7eb9\u7406\uff0c\u6fc0\u5149\u5fae\u96d5\u7684\u540d\u5b57\u6210\u4e3a\u8fd9\u4ef6\u5668\u7269\u4e0a\u6700\u51b7\u9759\u7684\u6ce8\u811a\u3002\u5b83\u4e0d\u53ea\u662f\u676f\u57ab\uff0c\u66f4\u662f\u684c\u9762\u4e0a\u7684\u5fae\u578b\u96d5\u5851\u3002",scene:"\u4e54\u8fc1\u9001\u793c\u3001\u65b0\u5a5a\u8d3a\u793c\u3001\u5496\u5561\u89d2\u5e03\u7f6e\u3001\u529e\u516c\u684c\u7f8e\u5b66\u3002\u9002\u5408\u9001\u7ed9\u559c\u6b22\u624b\u51b2\u5496\u5561\u7684\u670b\u53cb\uff0c\u6216\u4f5c\u4e3a\u5a5a\u793c\u5bbe\u5ba2\u7684\u56de\u793c\u2014\u2014\u6bcf\u4e00\u53ea\u676f\u57ab\u4e0a\u90fd\u523b\u7740\u5bbe\u5ba2\u7684\u540d\u5b57\uff0c\u8ba9\u793c\u7269\u672c\u8eab\u6210\u4e3a\u5ea7\u4f4d\u5361\u3002",tags:["\u4e54\u8fc1\u793c","\u65b0\u5a5a\u8d3a\u793c","\u684c\u9762\u7f8e\u5b66","\u9ec4\u94dc","\u624b\u51b2\u5496\u5561"],specs:[["\u6750\u8d28","\u9ec4\u94dc + \u80cc\u9762\u8f6f\u6728\u9632\u6ed1\u57ab"],["\u8868\u9762\u5904\u7406","\u62c9\u4e1d\u54d1\u5149"],["\u76f4\u5f84","100mm"],["\u539a\u5ea6","3mm"],["\u96d5\u523b\u5de5\u827a","\u5149\u7ea4\u6fc0\u5149\u7cbe\u7ec6\u5fae\u96d5"],["\u8010\u6e29","\u2264120\xb0C"]],images:["/img/cup/The1.jpg"],mask:{shape:"circle",width:280,height:280}},{id:"penbox",name:"\u7af9\u5236\u7b14\u76d2",desc:"\u81ea\u7136\u7af9\u7eb9\uff0c\u6587\u623f\u96c5\u5668",icon:"\u270f\ufe0f",iconImg:"/icon/\u7b14\u76d2.png",price:75,originalPrice:98,leadTime:"7-10\u4e2a\u5de5\u4f5c\u65e5",description:"\u7cbe\u9009\u5929\u7136\u6960\u7af9\uff0c\u7ecf\u591a\u9053\u5de5\u5e8f\u6253\u78e8\u629b\u5149\uff0c\u4fdd\u7559\u5929\u7136\u7af9\u7eb9\u808c\u7406\u3002\u76d2\u76d6\u91c7\u7528\u78c1\u5438\u5f00\u5408\uff0c\u5185\u90e8\u8bbe\u6709\u5206\u5c42\u9694\u677f\u3002\u6fc0\u5149\u5fae\u96d5\u5728\u7af9\u9762\u4e0a\u5448\u73b0\u6df1\u6d45\u4e0d\u4e00\u7684\u96d5\u523b\u6548\u679c\uff0c\u878d\u5165\u58a8\u9999\u6c14\u8d28\u3002\u9002\u5408\u4e66\u623f\u6848\u5934\u3001\u4e66\u6cd5\u7231\u597d\u8005\u7684\u6587\u623f\u4f34\u4fa3\u3002",subtitle:"\u5929\u7136\u6960\u7af9 \xb7 \u78c1\u5438\u5f00\u5408 \xb7 \u6587\u623f\u96c5\u5668\u4e4b\u9009",tone:[30,24,16],story:"\u6bcf\u4e00\u53ea\u7b14\u76d2\u90fd\u6765\u81ea\u540c\u4e00\u7247\u7af9\u6797\u7684\u4e0d\u540c\u90e8\u4f4d\uff0c\u56e0\u6b64\u7eb9\u8def\u7edd\u4e0d\u91cd\u590d\u2014\u2014\u6b63\u5982\u6ca1\u6709\u4e24\u4e2a\u4eba\u7684\u4e66\u6cd5\u98ce\u683c\u5b8c\u5168\u76f8\u540c\u3002\u6211\u4eec\u4fdd\u7559\u4e86\u6960\u7af9\u5929\u7136\u7684\u6e29\u6da6\u89e6\u611f\uff0c\u53ea\u5728\u8868\u9762\u4ee5\u6fc0\u5149\u523b\u4e0b\u540d\u5b57\u6216\u4e00\u53e5\u7bb4\u8a00\u3002\u6253\u5f00\u78c1\u5438\u76d2\u76d6\u65f6\u7684\u6e05\u8106\u58f0\u54cd\uff0c\u662f\u6587\u623f\u4e2d\u7684\u5c0f\u5c0f\u4eea\u5f0f\u3002",scene:"\u4e66\u623f\u6848\u5934\u3001\u4e66\u6cd5\u7231\u597d\u8005\u88c5\u5907\u3001\u6559\u5e08\u8282\u793c\u7269\u3001\u4e66\u623f\u6696\u623f\u793c\u3002\u9002\u5408\u9001\u7ed9\u5199\u5b57\u597d\u770b\u7684\u4eba\u2014\u2014\u56e0\u4e3a\u61c2\u4e66\u5199\u7684\u4eba\uff0c\u624d\u61c2\u4e00\u53ea\u597d\u7b14\u76d2\u7684\u5206\u91cf\u3002",tags:["\u6587\u623f","\u4e66\u6cd5","\u6559\u5e08\u8282","\u4e66\u623f","\u5929\u7136\u6750\u8d28"],specs:[["\u6750\u8d28","\u5929\u7136\u6960\u7af9"],["\u5f00\u5408\u65b9\u5f0f","\u78c1\u5438\u5f0f\u76d2\u76d6"],["\u5185\u90e8\u7ed3\u6784","\u5206\u5c42\u9694\u677f\uff08\u53ef\u8c03\u8282\uff09"],["\u5c3a\u5bf8","200 \xd7 65 \xd7 30mm"],["\u8868\u9762\u5904\u7406","\u624b\u5de5\u6253\u78e8\u629b\u5149\uff0c\u65e0\u6f06"],["\u96d5\u523b\u5de5\u827a","CO2 \u6fc0\u5149\u70e7\u8680\uff08\u6df1\u6d45\u53ef\u8c03\uff09"]],images:["/img/penbox/The1.jpg","/img/penbox/The2.jpg","/img/penbox/The3.jpg"],mask:{shape:"rect",width:320,height:160,borderRadius:12}},{id:"booklamp",name:"\u4e66\u672c\u578b\u706f",desc:"\u6e29\u6696\u5149\u5f71\uff0c\u70b9\u4eae\u5fc3\u610f",icon:"\ud83d\udca1",iconImg:"/icon/\u4e66\u706f.png",price:45,originalPrice:68,leadTime:"5-7\u4e2a\u5de5\u4f5c\u65e5",description:"\u5f00\u5408\u5f0f\u8bbe\u8ba1\uff0c\u6253\u5f00\u5373\u4eae\uff0c\u5408\u62e2\u5373\u706d\uff0c\u5982\u9b54\u6cd5\u4e66\u822c\u5145\u6ee1\u60ca\u559c\u3002\u91c7\u7528LED\u6696\u5149\u706f\u6e90\uff0c\u5149\u7ebf\u67d4\u548c\u4e0d\u523a\u773c\uff0c\u53ef\u6301\u7eed\u70b9\u4eae6-8\u5c0f\u65f6\u3002\u5c01\u9762\u6fc0\u5149\u5fae\u96d5\u53ef\u5b9a\u5236\u6587\u5b57\u3001\u56fe\u6848\u6216\u7167\u7247\uff0c\u8ba9\u6e29\u6696\u7684\u706f\u5149\u627f\u8f7d\u4e13\u5c5e\u8bb0\u5fc6\u3002\u662f\u60c5\u4fa3\u793c\u7269\u3001\u6bd5\u4e1a\u793c\u7269\u7684\u521b\u610f\u4e4b\u9009\u3002",subtitle:"\u5f00\u5408\u5373\u4eae \xb7 LED\u6696\u5149 \xb7 \u9b54\u6cd5\u4e66\u822c\u7684\u60ca\u559c",tone:[25,20,15],story:"\u7075\u611f\u6765\u81ea\u300a\u54c8\u5229\xb7\u6ce2\u7279\u300b\u4e2d\u7684\u9b54\u6cd5\u8bfe\u672c\u2014\u2014\u6253\u5f00\u4e00\u672c\u4e66\uff0c\u5149\u8292\u503e\u6cfb\u800c\u51fa\u3002\u6211\u4eec\u91c7\u7528\u675c\u90a6\u7eb8\u4e0e\u5b9e\u6728\u5c01\u9762\u7ed3\u5408\uff0c\u8ba9\u706f\u4f53\u65e2\u8f7b\u8584\u53c8\u575a\u56fa\u3002\u6fc0\u5149\u5fae\u96d5\u5728\u5c01\u9762\u7559\u4e0b\u4f60\u7684\u540d\u5b57\u6216\u4e00\u5e45\u5c0f\u753b\uff0c\u5f53\u706f\u5728\u6df1\u591c\u4eae\u8d77\uff0c\u90a3\u662f\u4e13\u5c5e\u4e8e\u4f60\u7684\u6e29\u6696\u89d2\u843d\u3002",scene:"\u60c5\u4fa3\u793c\u7269\u3001\u6bd5\u4e1a\u7eaa\u5ff5\u3001\u5e8a\u5934\u591c\u706f\u3001\u9732\u8425\u6c1b\u56f4\u706f\u3001\u513f\u7ae5\u623f\u3002\u7279\u522b\u9002\u5408\u5728\u5c01\u9762\u523b\u4e0a\u4e24\u4e2a\u4eba\u7684\u540d\u5b57\u548c\u4e00\u53e5\u60c5\u8bdd\uff0c\u5728\u60c5\u4eba\u8282\u6216\u7eaa\u5ff5\u65e5\u9001\u51fa\u2014\u2014\u6253\u5f00\u4e66\u706f\uff0c\u5c31\u50cf\u6253\u5f00\u4e00\u5c01\u4f1a\u53d1\u5149\u7684\u60c5\u4e66\u3002",tags:["\u60c5\u4fa3\u793c","\u6bd5\u4e1a\u7eaa\u5ff5","\u591c\u706f","\u6c1b\u56f4\u706f","\u521b\u610f\u793c\u7269"],specs:[["\u5149\u6e90","LED \u6696\u767d\u5149\uff083000K\uff09"],["\u7eed\u822a","6-8\u5c0f\u65f6\uff08\u5185\u7f6e\u53ef\u5145\u7535\u9502\u7535\u6c60\uff09"],["\u5145\u7535","USB Type-C \u63a5\u53e3"],["\u5c01\u9762\u6750\u8d28","\u675c\u90a6\u7eb8 + \u5b9e\u6728\u5c01\u9762"],["\u5c55\u5f00\u5c3a\u5bf8","210 \xd7 150mm"],["\u96d5\u523b\u5de5\u827a","\u6fc0\u5149\u5fae\u96d5\uff08\u652f\u6301\u6587\u5b57+\u7b80\u5355\u56fe\u6848\uff09"]],images:["/img/booklight/The1.jpg","/img/booklight/The2.jpg"],mask:{shape:"rect",width:320,height:240,borderRadius:4}}],u=i.map(function(n){return(0,r.A)((0,r.A)({},n),{},{images:(n.images||[]).map(function(n){return(0,o.uq)(n)}),iconImg:(0,o.uq)(n.iconImg)})}),c=u,a=function(n){return u.find(function(t){return t.id===n})},s={"notebook-small":(0,o.uq)("/icon/\u4e66\u672c.png"),"notebook-large":(0,o.uq)("/icon/\u4e66\u672c_\u5927.png"),coaster:(0,o.uq)("/icon/\u676f\u5b50.png"),penbox:(0,o.uq)("/icon/\u7b14\u76d2.png"),booklamp:(0,o.uq)("/icon/\u4e66\u706f.png")};function d(n){return null!==n&&void 0!==n&&n.iconImg?(0,o.uq)(n.iconImg):null!==n&&void 0!==n&&n.id?(0,o.uq)(s[n.id]||"/icon/\u56db\u89d2\u661f.png"):(0,o.uq)("/icon/\u56db\u89d2\u661f.png")}},3246:function(n,t,e){e.d(t,{L:function(){return g},Sy:function(){return d},WG:function(){return l},gf:function(){return f}});var r=e(1212),o=e(9379),i=e(467),u=e(758),c=e.n(u),a="https://wxbackend.tokenleaping.com",s="smart_access_token";function d(){try{c().hideLoading()}catch(n){}}function f(){try{return c().getStorageSync(s)||""}catch(n){return""}}function l(n){c().setStorageSync(s,n)}function g(){try{c().removeStorageSync(s)}catch(n){}}function h(n){return p.apply(this,arguments)}function p(){return p=(0,i.A)((0,r.A)().m(function n(t){var e,i,u,s,d,l,h,p,v,S,y,k,A,b=arguments;return(0,r.A)().w(function(n){while(1)switch(n.p=n.n){case 0:return e=b.length>1&&void 0!==b[1]?b[1]:{},i=e.method,u=void 0===i?"GET":i,s=e.data,d=e.headers,l=void 0===d?{}:d,h=e.auth,p=void 0===h||h,v=f(),S=(0,o.A)((0,o.A)({"Content-Type":"application/json"},p&&v?{Authorization:"Bearer ".concat(v)}:{}),l),n.p=1,n.n=2,c().request({url:"".concat(a).concat(t),method:u,data:s,header:S});case 2:y=n.v,n.n=4;break;case 3:throw n.p=3,n.v,new Error("\u7f51\u7edc\u5f02\u5e38\uff0c\u8bf7\u7a0d\u540e\u91cd\u8bd5");case 4:if(401!==y.statusCode){n.n=5;break}throw g(),null===(k=m)||void 0===k||k(),new Error("\u767b\u5f55\u5df2\u8fc7\u671f\uff0c\u8bf7\u91cd\u65b0\u767b\u5f55");case 5:if(A=y.data,!A||"number"!==typeof A.code||0===A.code){n.n=6;break}throw new Error(A.message||"\u8bf7\u6c42\u5931\u8d25");case 6:return n.a(2,A&&"number"===typeof A.code?A.data:A)}},n,null,[[1,3]])})),p.apply(this,arguments)}var m=null;var v={get:function(n,t){return h(n,(0,o.A)((0,o.A)({},t),{},{method:"GET"}))},post:function(n,t,e){return h(n,(0,o.A)((0,o.A)({},e),{},{method:"POST",data:t}))},put:function(n,t,e){return h(n,(0,o.A)((0,o.A)({},e),{},{method:"PUT",data:t}))},patch:function(n,t,e){return h(n,(0,o.A)((0,o.A)({},e),{},{method:"PATCH",data:t}))},del:function(n,t){return h(n,(0,o.A)((0,o.A)({},t),{},{method:"DELETE"}))}};t.Ay=v},8594:function(n,t,e){e.d(t,{E1:function(){return Z},EB:function(){return X},F0:function(){return F},Fu:function(){return G},Hf:function(){return T},IU:function(){return L},Ic:function(){return g},O4:function(){return Y},Q1:function(){return x},Q4:function(){return A},Re:function(){return J},Rq:function(){return Q},ab:function(){return V},cY:function(){return R},eW:function(){return z},hG:function(){return E},i5:function(){return W},iA:function(){return w},iZ:function(){return j},kg:function(){return I},kh:function(){return H},n7:function(){return O},p_:function(){return q},uF:function(){return B},ug:function(){return _},yU:function(){return $}});var r=e(9379),o=e(436),i=e(758),u=e.n(i),c=e(5234),a=e(8199),s=e(6764),d="smart_theme",f="smart_user_info",l="smart_active_openid";function g(n){return!!n&&(n.startsWith("mock_")||n.startsWith("mock-"))}function h(){var n=A(),t=(null===n||void 0===n?void 0:n.openid)||u().getStorageSync(l)||"_guest_";return u().setStorageSync(l,t),t}function p(n){var t=h();return"".concat(n,"_").concat(t)}var m="smart_user_registry",v="zhihui2024";function S(){try{return u().getStorageSync(m)||[]}catch(n){return[]}}function y(n){var t=S();t.includes(n)||(t.push(n),u().setStorageSync(m,t))}function k(n){var t=S().filter(function(t){return t!==n});u().setStorageSync(m,t)}function A(){try{return u().getStorageSync(f)}catch(n){return null}}function b(n){var t;u().setStorageSync(f,n),null!==n&&void 0!==n&&n.openid&&(u().setStorageSync(l,n.openid),u().setStorageSync("user_info_".concat(n.openid),n),y(n.openid)),(0,s.m)(),null===(t=u().eventCenter)||void 0===t||t.trigger("authStateChanged",{openid:(null===n||void 0===n?void 0:n.openid)||""})}function C(n){try{var t=u().getStorageSync("user_info_".concat(n));if(t)return t}catch(n){}var e=A();return(null===e||void 0===e?void 0:e.openid)===n?e:null}function T(){var n;u().removeStorageSync(f),u().removeStorageSync(l),(0,s.m)(),null===(n=u().eventCenter)||void 0===n||n.trigger("authStateChanged",{openid:""})}function w(n){b(n)}function _(){return A()}function x(){var n=S();return n.map(function(n){var t=C(n),e=N(n),r=P(n);return{openid:n,nickName:(null===t||void 0===t?void 0:t.nickName)||"\u672a\u77e5\u7528\u6237",avatarUrl:(null===t||void 0===t?void 0:t.avatarUrl)||"",loginAt:(null===t||void 0===t?void 0:t.loginAt)||0,designCount:e.length,orderCount:r.length}})}function I(n,t){var e="mock_"+Date.now().toString(36)+"_"+Math.random().toString(36).slice(2,6),r={openid:e,nickName:n||"\u5fae\u4fe1\u7528\u6237",avatarUrl:t||"",loginAt:Date.now()};return b(r),r}function j(n){var t=C(n);return!!t&&(u().setStorageSync(f,t),u().setStorageSync(l,n),!0)}function E(n){u().removeStorageSync("user_info_".concat(n)),u().removeStorageSync("design_list_".concat(n)),u().removeStorageSync("order_list_".concat(n)),u().removeStorageSync("address_list_".concat(n)),k(n);var t=A();(null===t||void 0===t?void 0:t.openid)===n&&T()}function B(n){return n===v}function D(n,t){return"".concat(n,"_").concat(t)}function N(n){try{return u().getStorageSync(D("design_list",n))||[]}catch(n){return[]}}function P(n){try{return u().getStorageSync(D("order_list",n))||[]}catch(n){return[]}}function q(){try{return u().getStorageSync(p("design_list"))||[]}catch(n){return[]}}function G(n){u().setStorageSync(p("design_list"),n)}function R(n,t){var e=q(),r=(0,a.uq)((null===n||void 0===n?void 0:n.iconImg)||c.rj[null===n||void 0===n?void 0:n.id]||"/icon/\u56db\u89d2\u661f.png"),i={id:"DSG"+Date.now(),productId:n.id,productName:n.name,productIcon:r,unitPrice:n.price,count:t,status:"undesigned",createdAt:(new Date).toISOString().slice(0,10)};return G([].concat((0,o.A)(e),[i])),i}function W(n,t){var e=q(),o=e.findIndex(function(t){return t.id===n});-1!==o&&(e[o]=(0,r.A)((0,r.A)({},e[o]),t),G(e))}function H(n){var t=q().filter(function(t){return!n.includes(t.id)});G(t)}function O(){try{return u().getStorageSync(p("order_list"))||[]}catch(n){return[]}}function U(n){u().setStorageSync(p("order_list"),n)}function L(n){var t,e=q(),r=O(),i=e.find(function(t){return t.id===n});if(!i)return null;var u=null!==(t=i.productIcon)&&void 0!==t&&t.startsWith("/icon/")||/^https?:/i.test(i.productIcon||"")?i.productIcon:c.rj[i.productId]||"/icon/\u56db\u89d2\u661f.png",s=(0,a.uq)(u),d={id:"ORD"+Date.now().toString().slice(-9),productName:i.productName,productIcon:s,statusCode:"pending",date:(new Date).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).replace(/\//g,"-"),price:"\xa5"+(i.unitPrice*i.count).toFixed(2),count:i.count,sku:"".concat(i.productName," \xd7 ").concat(i.count)},f=e.findIndex(function(t){return t.id===n});return-1!==f&&(e[f].status="ordered",e[f].orderId=d.id),G(e),U([d].concat((0,o.A)(r))),d}function Y(){try{return u().getStorageSync(d)||"auto"}catch(n){return"auto"}}function F(n){u().setStorageSync(d,n)}var M=null;function Q(n){M=n}function z(n){if("auto"===n){if(M)return M;try{var t=u().getAppBaseInfo();if("dark"===t.theme||"light"===t.theme)return t.theme}catch(n){}return"light"}return n}function J(){try{return u().getStorageSync(p("address_list"))||[]}catch(n){return[]}}function K(n){u().setStorageSync(p("address_list"),n)}function Z(n){var t=J(),e=(0,r.A)((0,r.A)({},n),{},{id:"ADR"+Date.now()});return e.isDefault&&t.forEach(function(n){n.isDefault=!1}),K([e].concat((0,o.A)(t))),e}function $(n,t){var e=J(),o=e.findIndex(function(t){return t.id===n});-1!==o&&(t.isDefault&&e.forEach(function(n){n.isDefault=!1}),e[o]=(0,r.A)((0,r.A)({},e[o]),t),K(e))}function V(n){var t=J().filter(function(t){return t.id!==n});K(t)}function X(){return J().find(function(n){return n.isDefault})}},6606:function(n,t,e){e.d(t,{G:function(){return u}});var r=e(758),o=e.n(r);function i(n){return"dark"===n?"#191919":"#ffffff"}function u(n,t){var e=null!==t&&void 0!==t?t:i(n);o().setBackgroundColor({backgroundColor:e,backgroundColorTop:e,backgroundColorBottom:e}),o().setBackgroundTextStyle({textStyle:"dark"===n?"light":"dark"})}}}]); \ No newline at end of file diff --git a/dist/pages/designList/index.js b/dist/pages/designList/index.js index 33492bc..ddc8ad9 100644 --- a/dist/pages/designList/index.js +++ b/dist/pages/designList/index.js @@ -1 +1 @@ -"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[319],{3512:function(e,s,n){var a=n(7842),c=n(5544),t=n(118),i=n(758),l=n.n(i),d=n(6540),r=n(8594),o=n(5234),u=n(9703),h=n(9201),g=n(5414),m=n(7723),x=n(9674),b=n(4848),j=[{code:"all",label:"\u5168\u90e8"},{code:"toDesign",label:"\u5f85\u8bbe\u8ba1"},{code:"undesigned",label:"\u672a\u8bbe\u8ba1"},{code:"designing",label:"\u8bbe\u8ba1\u4e2d"},{code:"ordered",label:"\u5df2\u4e0b\u5355"}],p={undesigned:{label:"\u672a\u8bbe\u8ba1",cls:"badge-pink"},designing:{label:"\u8bbe\u8ba1\u4e2d",cls:"badge-blue"},ordered:{label:"\u5df2\u4e0b\u5355",cls:"badge-green"}};function f(){var e=(0,u.wR)(),s=e.resolvedTheme,n=(0,h.c)();(0,g.l)(s);var a=(0,d.useState)("all"),i=(0,c.A)(a,2),f=i[0],S=i[1],N=(0,d.useState)([]),w=(0,c.A)(N,2),v=w[0],T=w[1],E=(0,d.useState)(!1),Y=(0,c.A)(E,2),y=Y[0],k=Y[1],A=(0,d.useState)(new Set),z=(0,c.A)(A,2),P=z[0],I=z[1],B=(0,d.useCallback)(function(){T((0,r.p_)())},[]),C=(0,d.useCallback)(function(){var e=l().getStorageSync("designList:filter");e&&j.some(function(s){return s.code===e})&&(S(e),l().removeStorageSync("designList:filter")),B()},[B]);(0,d.useEffect)(function(){var e=l().getCurrentInstance().page;if(e){var s=e.onShow;e.onShow=function(){C(),s&&s.apply(this)}}C()},[C]);var L="all"===f?v:"toDesign"===f?v.filter(function(e){return"undesigned"===e.status||"designing"===e.status}):v.filter(function(e){return e.status===f}),M=function(e){"ordered"!==e.status?l().navigateTo({url:"/pages/diy/index?source=designList&designId=".concat(e.id)}):l().showToast({title:"\u8be5\u5546\u54c1\u5df2\u4e0b\u5355\uff0c\u8bf7\u67e5\u770b\u8ba2\u5355",icon:"none"})},F=function(e){var s=new Set(P);s.has(e)?s.delete(e):s.add(e),I(s)},_=function(){P.size===L.length?I(new Set):I(new Set(L.map(function(e){return e.id})))},D=function(){0!==P.size&&l().showModal({title:"\u786e\u8ba4\u5220\u9664",content:"\u786e\u5b9a\u5220\u9664\u9009\u4e2d\u7684 ".concat(P.size," \u4e2a\u6761\u76ee\u5417\uff1f"),success:function(e){e.confirm&&((0,r.kh)(Array.from(P)),I(new Set),k(!1),B())}})},J=function(){y?(k(!1),I(new Set)):k(!0)};return(0,b.jsxs)(t.Ss,{className:"theme-".concat(s),children:[(0,b.jsx)(x.A,{}),(0,b.jsx)(m.A,{children:(0,b.jsxs)(t.Ss,{className:"design-page",children:[(0,b.jsx)(t.Ss,{className:"page-header dashed-card mt-20",style:{marginTop:"".concat(n.headerPaddingTop,"px")},children:(0,b.jsxs)(t.Ss,{className:"flex-between",style:{width:"100%"},children:[(0,b.jsx)(t.EY,{className:"back-btn",onTap:function(){return l().navigateBack()},children:"\u2190"}),(0,b.jsx)(t.EY,{className:"page-title",children:"\u6211\u7684\u8bbe\u8ba1\u6e05\u5355"}),(0,b.jsx)(t.EY,{className:"manage-btn",onTap:J,children:y?"\u5b8c\u6210":"\u7ba1\u7406"})]})}),(0,b.jsx)(t.Ss,{className:"status-tabs",children:(0,b.jsx)(t.BM,{className:"tabs-scroll",scrollX:!0,children:j.map(function(e){return(0,b.jsxs)(t.Ss,{className:"tab-item ".concat(f===e.code?"active":""),onTap:function(){return S(e.code)},children:[(0,b.jsx)(t.EY,{className:"tab-label",children:e.label}),f===e.code&&(0,b.jsx)(t.Ss,{className:"tab-underline"})]},e.code)})})}),y&&(0,b.jsx)(t.Ss,{className:"batch-bar dashed-card",children:(0,b.jsxs)(t.Ss,{className:"flex-between",style:{width:"100%"},children:[(0,b.jsxs)(t.Ss,{className:"batch-select-all",onTap:_,children:[(0,b.jsx)(t.Ss,{className:"batch-checkbox ".concat(P.size===L.length&&L.length>0?"checked":"")}),(0,b.jsxs)(t.EY,{className:"batch-text",children:["\u5168\u9009 (",P.size,"/",L.length,")"]})]}),(0,b.jsx)(t.Ss,{className:"batch-delete ".concat(P.size>0?"active":""),onTap:D,children:(0,b.jsx)(t.EY,{children:"\u5220\u9664"})})]})}),(0,b.jsxs)(t.BM,{className:"design-list",scrollY:!0,children:[L.map(function(e){var s,n=p[e.status],a=null!==(s=e.productIcon)&&void 0!==s&&s.startsWith("/icon/")?e.productIcon:o.rj[e.productId]||"/icon/\u56db\u89d2\u661f.png",c=P.has(e.id);return(0,b.jsxs)(t.Ss,{className:"design-card dashed-card ".concat(c?"selected":""),onTap:function(){return y?F(e.id):void 0},children:[(0,b.jsxs)(t.Ss,{className:"design-body",children:[y&&(0,b.jsx)(t.Ss,{className:"batch-checkbox ".concat(c?"checked":"")}),(0,b.jsx)(t._V,{className:"design-icon-img",src:a,mode:"aspectFit"}),(0,b.jsxs)(t.Ss,{className:"design-info",children:[(0,b.jsxs)(t.Ss,{className:"design-title-row",children:[(0,b.jsx)(t.EY,{className:"design-name",children:e.productName}),(0,b.jsx)(t.EY,{className:"badge ".concat(n.cls),children:n.label})]}),(0,b.jsxs)(t.EY,{className:"design-meta",children:["\u6570\u91cf: ",e.count," \u4ef6 | \u5355\u4ef7: \xa5",e.unitPrice]}),(0,b.jsxs)(t.EY,{className:"design-total",children:["\u5c0f\u8ba1: \xa5",(e.unitPrice*e.count).toFixed(2)]})]})]}),!y&&(0,b.jsxs)(t.Ss,{className:"design-actions",children:["ordered"!==e.status&&(0,b.jsx)(t.Ss,{className:"btn-gradient design-btn",onTap:function(){return M(e)},children:(0,b.jsx)(t.EY,{children:"undesigned"===e.status?"\u5f00\u59cb\u8bbe\u8ba1":"\u7ee7\u7eed\u8bbe\u8ba1"})}),"ordered"===e.status&&(0,b.jsx)(t.Ss,{className:"btn-outline design-btn",onTap:function(){return l().switchTab({url:"/pages/orders/index"})},children:(0,b.jsx)(t.EY,{children:"\u67e5\u770b\u8ba2\u5355"})})]})]},e.id)}),0===L.length&&(0,b.jsxs)(t.Ss,{className:"empty-state",children:[(0,b.jsx)(t._V,{className:"empty-icon-img",src:"/icon/\u8c03\u8272\u76d8.png",mode:"aspectFit"}),(0,b.jsx)(t.EY,{className:"empty-text",children:"\u8fd8\u6ca1\u6709\u8bbe\u8ba1\u6e05\u5355"}),(0,b.jsx)(t.EY,{className:"empty-sub",children:"\u53bb\u9996\u9875\u901b\u901b\uff0c\u627e\u5230\u559c\u6b22\u7684\u5b9a\u5236\u54c1"}),(0,b.jsx)(t.Ss,{className:"btn-gradient",onTap:function(){return l().switchTab({url:"/pages/index/index"})},children:(0,b.jsx)(t.EY,{children:"\u53bb\u901b\u901b"})})]})]}),(0,b.jsx)(t.Ss,{style:{height:"40px"}})]})})]})}var S={navigationStyle:"custom",enablePageMeta:!0,navigationBarTitleText:"\u8bbe\u8ba1\u6e05\u5355"};Page((0,a.createPageConfig)(f,"pages/designList/index",{root:{cn:[]}},S||{}))}},function(e){var s=function(s){return e(e.s=s)};e.O(0,[907,96,76],function(){return s(3512)});e.O()}]); \ No newline at end of file +"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[319],{3512:function(e,s,n){var a=n(7842),t=n(5544),c=n(118),i=n(758),l=n.n(i),d=n(6540),r=n(8594),o=n(5234),u=n(8199),h=n(9703),g=n(9201),m=n(5414),x=n(7723),b=n(9674),p=n(4848),j=[{code:"all",label:"\u5168\u90e8"},{code:"toDesign",label:"\u5f85\u8bbe\u8ba1"},{code:"undesigned",label:"\u672a\u8bbe\u8ba1"},{code:"designing",label:"\u8bbe\u8ba1\u4e2d"},{code:"ordered",label:"\u5df2\u4e0b\u5355"}],f={undesigned:{label:"\u672a\u8bbe\u8ba1",cls:"badge-pink"},designing:{label:"\u8bbe\u8ba1\u4e2d",cls:"badge-blue"},ordered:{label:"\u5df2\u4e0b\u5355",cls:"badge-green"}};function S(){var e=(0,h.wR)(),s=e.resolvedTheme,n=(0,g.c)();(0,m.l)(s);var a=(0,d.useState)("all"),i=(0,t.A)(a,2),S=i[0],N=i[1],w=(0,d.useState)([]),v=(0,t.A)(w,2),T=v[0],E=v[1],Y=(0,d.useState)(!1),y=(0,t.A)(Y,2),k=y[0],A=y[1],z=(0,d.useState)(new Set),I=(0,t.A)(z,2),P=I[0],B=I[1],C=(0,d.useCallback)(function(){E((0,r.p_)())},[]),L=(0,d.useCallback)(function(){var e=l().getStorageSync("designList:filter");e&&j.some(function(s){return s.code===e})&&(N(e),l().removeStorageSync("designList:filter")),C()},[C]);(0,d.useEffect)(function(){var e=l().getCurrentInstance().page;if(e){var s=e.onShow;e.onShow=function(){L(),s&&s.apply(this)}}L()},[L]);var M="all"===S?T:"toDesign"===S?T.filter(function(e){return"undesigned"===e.status||"designing"===e.status}):T.filter(function(e){return e.status===S}),F=function(e){"ordered"!==e.status?l().navigateTo({url:"/pages/diy/index?source=designList&designId=".concat(e.id)}):l().showToast({title:"\u8be5\u5546\u54c1\u5df2\u4e0b\u5355\uff0c\u8bf7\u67e5\u770b\u8ba2\u5355",icon:"none"})},_=function(e){var s=new Set(P);s.has(e)?s.delete(e):s.add(e),B(s)},D=function(){P.size===M.length?B(new Set):B(new Set(M.map(function(e){return e.id})))},J=function(){0!==P.size&&l().showModal({title:"\u786e\u8ba4\u5220\u9664",content:"\u786e\u5b9a\u5220\u9664\u9009\u4e2d\u7684 ".concat(P.size," \u4e2a\u6761\u76ee\u5417\uff1f"),success:function(e){e.confirm&&((0,r.kh)(Array.from(P)),B(new Set),A(!1),C())}})},O=function(){k?(A(!1),B(new Set)):A(!0)};return(0,p.jsxs)(c.Ss,{className:"theme-".concat(s),children:[(0,p.jsx)(b.A,{}),(0,p.jsx)(x.A,{children:(0,p.jsxs)(c.Ss,{className:"design-page",children:[(0,p.jsx)(c.Ss,{className:"page-header dashed-card mt-20",style:{marginTop:"".concat(n.headerPaddingTop,"px")},children:(0,p.jsxs)(c.Ss,{className:"flex-between",style:{width:"100%"},children:[(0,p.jsx)(c.EY,{className:"back-btn",onTap:function(){return l().navigateBack()},children:"\u2190"}),(0,p.jsx)(c.EY,{className:"page-title",children:"\u6211\u7684\u8bbe\u8ba1\u6e05\u5355"}),(0,p.jsx)(c.EY,{className:"manage-btn",onTap:O,children:k?"\u5b8c\u6210":"\u7ba1\u7406"})]})}),(0,p.jsx)(c.Ss,{className:"status-tabs",children:(0,p.jsx)(c.BM,{className:"tabs-scroll",scrollX:!0,children:j.map(function(e){return(0,p.jsxs)(c.Ss,{className:"tab-item ".concat(S===e.code?"active":""),onTap:function(){return N(e.code)},children:[(0,p.jsx)(c.EY,{className:"tab-label",children:e.label}),S===e.code&&(0,p.jsx)(c.Ss,{className:"tab-underline"})]},e.code)})})}),k&&(0,p.jsx)(c.Ss,{className:"batch-bar dashed-card",children:(0,p.jsxs)(c.Ss,{className:"flex-between",style:{width:"100%"},children:[(0,p.jsxs)(c.Ss,{className:"batch-select-all",onTap:D,children:[(0,p.jsx)(c.Ss,{className:"batch-checkbox ".concat(P.size===M.length&&M.length>0?"checked":"")}),(0,p.jsxs)(c.EY,{className:"batch-text",children:["\u5168\u9009 (",P.size,"/",M.length,")"]})]}),(0,p.jsx)(c.Ss,{className:"batch-delete ".concat(P.size>0?"active":""),onTap:J,children:(0,p.jsx)(c.EY,{children:"\u5220\u9664"})})]})}),(0,p.jsxs)(c.BM,{className:"design-list",scrollY:!0,children:[M.map(function(e){var s,n=f[e.status],a=null!==(s=e.productIcon)&&void 0!==s&&s.startsWith("/icon/")||/^https?:/i.test(e.productIcon||"")?e.productIcon:o.rj[e.productId]||"/icon/\u56db\u89d2\u661f.png",t=(0,u.uq)(a),i=P.has(e.id);return(0,p.jsxs)(c.Ss,{className:"design-card dashed-card ".concat(i?"selected":""),onTap:function(){return k?_(e.id):void 0},children:[(0,p.jsxs)(c.Ss,{className:"design-body",children:[k&&(0,p.jsx)(c.Ss,{className:"batch-checkbox ".concat(i?"checked":"")}),(0,p.jsx)(c._V,{className:"design-icon-img",src:t,mode:"aspectFit"}),(0,p.jsxs)(c.Ss,{className:"design-info",children:[(0,p.jsxs)(c.Ss,{className:"design-title-row",children:[(0,p.jsx)(c.EY,{className:"design-name",children:e.productName}),(0,p.jsx)(c.EY,{className:"badge ".concat(n.cls),children:n.label})]}),(0,p.jsxs)(c.EY,{className:"design-meta",children:["\u6570\u91cf: ",e.count," \u4ef6 | \u5355\u4ef7: \xa5",e.unitPrice]}),(0,p.jsxs)(c.EY,{className:"design-total",children:["\u5c0f\u8ba1: \xa5",(e.unitPrice*e.count).toFixed(2)]})]})]}),!k&&(0,p.jsxs)(c.Ss,{className:"design-actions",children:["ordered"!==e.status&&(0,p.jsx)(c.Ss,{className:"btn-gradient design-btn",onTap:function(){return F(e)},children:(0,p.jsx)(c.EY,{children:"undesigned"===e.status?"\u5f00\u59cb\u8bbe\u8ba1":"\u7ee7\u7eed\u8bbe\u8ba1"})}),"ordered"===e.status&&(0,p.jsx)(c.Ss,{className:"btn-outline design-btn",onTap:function(){return l().switchTab({url:"/pages/orders/index"})},children:(0,p.jsx)(c.EY,{children:"\u67e5\u770b\u8ba2\u5355"})})]})]},e.id)}),0===M.length&&(0,p.jsxs)(c.Ss,{className:"empty-state",children:[(0,p.jsx)(c._V,{className:"empty-icon-img",src:"/icon/\u8c03\u8272\u76d8.png",mode:"aspectFit"}),(0,p.jsx)(c.EY,{className:"empty-text",children:"\u8fd8\u6ca1\u6709\u8bbe\u8ba1\u6e05\u5355"}),(0,p.jsx)(c.EY,{className:"empty-sub",children:"\u53bb\u9996\u9875\u901b\u901b\uff0c\u627e\u5230\u559c\u6b22\u7684\u5b9a\u5236\u54c1"}),(0,p.jsx)(c.Ss,{className:"btn-gradient",onTap:function(){return l().switchTab({url:"/pages/index/index"})},children:(0,p.jsx)(c.EY,{children:"\u53bb\u901b\u901b"})})]})]}),(0,p.jsx)(c.Ss,{style:{height:"40px"}})]})})]})}var N={navigationStyle:"custom",enablePageMeta:!0,navigationBarTitleText:"\u8bbe\u8ba1\u6e05\u5355"};Page((0,a.createPageConfig)(S,"pages/designList/index",{root:{cn:[]}},N||{}))}},function(e){var s=function(s){return e(e.s=s)};e.O(0,[907,96,76],function(){return s(3512)});e.O()}]); \ No newline at end of file diff --git a/dist/pages/index/index.js b/dist/pages/index/index.js index e69f81d..ce89b03 100644 --- a/dist/pages/index/index.js +++ b/dist/pages/index/index.js @@ -1 +1 @@ -"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[421],{7265:function(e,s,a){var c=a(7842),i=a(5544),t=a(118),r=a(758),n=a.n(r),l=a(6540),o=a(5234),m=a(9703),d=a(9201),h=a(5414),g=a(9674),p=a(4848),x=[{title:"\u6bd5\u4e1a\u7eaa\u5ff5\u7b14\u8bb0\u672c",desc:"\u5168\u73ed\u540d\u5b57\u7ec4\u6210\u6821\u5fbd",image:"/img/book_small/The1.jpg"},{title:"\u94dc\u8d28\u676f\u57ab",desc:"\u91d1\u5c5e\u8d28\u611f\u684c\u9762\u827a\u672f",image:"/img/cup/The1.jpg"},{title:"\u7af9\u5236\u7b14\u76d2",desc:"\u81ea\u7136\u7af9\u7eb9\u6587\u623f\u96c5\u5668",image:"/img/penbox/The1.jpg"},{title:"\u4e66\u672c\u578b\u706f",desc:"\u6e29\u6696\u5149\u5f71\u70b9\u4eae\u5fc3\u610f",image:"/img/booklight/The1.jpg"},{title:"\u60c5\u4fa3\u5b9a\u5236\u793c",desc:"\u4e24\u4e2a\u4eba\u7684\u540d\u5b57\u4ea4\u7ec7",image:"/img/book_big/The1.jpg"},{title:"\u4f01\u4e1a\u5e74\u4f1a\u793c",desc:"\u5458\u5de5\u540d\u5b57\u7ec4\u6210Logo",image:"/img/penbox/The2.jpg"}],j={"notebook-small":"/img/book_small/The1.jpg","notebook-large":"/img/book_big/The1.jpg",coaster:"/img/cup/The1.jpg",penbox:"/img/penbox/The1.jpg",booklamp:"/img/booklight/The1.jpg"};function u(){var e=(0,m.wR)(),s=(e.theme,e.resolvedTheme),a=(0,d.c)();(0,h.l)(s);var c=(0,l.useState)(""),r=(0,i.A)(c,2),u=r[0],N=r[1],b=function(e){n().navigateTo({url:"/pages/product/index?id=".concat(e)})},S=u.trim()?o.R6.filter(function(e){return e.name.includes(u)||e.desc.includes(u)}):o.R6,w=function(e){N(e.detail.value)};return(0,p.jsxs)(t.Ss,{className:"theme-".concat(s),children:[(0,p.jsx)(g.A,{}),(0,p.jsxs)(t.Ss,{className:"index-page",children:[(0,p.jsx)(t.Ss,{className:"header-bar",style:{paddingTop:"".concat(a.headerPaddingTop,"px")},children:(0,p.jsx)(t.EY,{className:"header-title",children:"\u667a\u7ed8\u5fae\u523b"})}),(0,p.jsxs)(t.Ss,{className:"search-card dashed-card",children:[(0,p.jsx)(t.Ss,{className:"star-badge"}),(0,p.jsxs)(t.Ss,{className:"search-inner",children:[(0,p.jsx)(t._V,{className:"search-icon-img",src:"/icon/\u641c\u7d22.png",mode:"aspectFit"}),(0,p.jsx)(t.pd,{className:"search-input",type:"text",placeholder:"\u641c\u7d22\u5b9a\u5236\u54c1\u7c7b\uff1a\u7b14\u8bb0\u672c\u3001\u676f\u57ab\u3001\u4e66\u706f...",value:u,onInput:w,confirmType:"search"})]}),u.trim()&&(0,p.jsx)(t.Ss,{className:"search-result-hint",children:(0,p.jsx)(t.EY,{className:"hint-text",children:S.length>0?"\u627e\u5230 ".concat(S.length," \u4e2a\u76f8\u5173\u54c1\u7c7b"):"\u6ca1\u6709\u627e\u5230\u76f8\u5173\u54c1\u7c7b\uff0c\u8bd5\u8bd5\u770b\u5176\u4ed6\u5173\u952e\u8bcd"})})]}),(0,p.jsxs)(t.Ss,{className:"showcase-section mt-20",children:[(0,p.jsx)(t.EY,{className:"section-title",children:"\u5b9a\u5236\u6210\u54c1\u5c55\u793a"}),(0,p.jsx)(t.RC,{className:"showcase-swiper",indicatorColor:"#e0e0e0",indicatorActiveColor:"#ff9a9e",circular:!0,autoplay:!0,interval:3e3,duration:500,previousMargin:"40rpx",nextMargin:"40rpx",indicatorDots:!0,children:x.map(function(e,s){return(0,p.jsx)(t.wu,{className:"showcase-swiper-item",children:(0,p.jsxs)(t.Ss,{className:"showcase-swiper-card dashed-card",children:[(0,p.jsx)(t.Ss,{className:"star-badge"}),(0,p.jsx)(t.Ss,{className:"showcase-image-wrapper",children:(0,p.jsx)(t._V,{className:"showcase-real-img",src:e.image,mode:"aspectFill"})}),(0,p.jsxs)(t.Ss,{className:"showcase-text-area",children:[(0,p.jsxs)(t.Ss,{className:"showcase-info",children:[(0,p.jsx)(t.EY,{className:"showcase-title",children:e.title}),(0,p.jsx)(t.EY,{className:"showcase-desc",children:e.desc})]}),(0,p.jsx)(t.Ss,{className:"showcase-tag",children:"\u6210\u54c1\u6848\u4f8b"})]})]})},s)})})]}),(0,p.jsxs)(t.Ss,{className:"category-section mt-20",children:[(0,p.jsx)(t.EY,{className:"section-title",children:"\u70ed\u95e8\u54c1\u7c7b"}),(0,p.jsx)(t.Ss,{className:"category-grid",children:S.map(function(e){return(0,p.jsxs)(t.Ss,{className:"category-item dashed-card",onTap:function(){return b(e.id)},children:[(0,p.jsx)(t.Ss,{className:"star-badge"}),(0,p.jsx)(t.Ss,{className:"category-img-wrapper",children:(0,p.jsx)(t._V,{className:"category-img-real",src:j[e.id]||"/icon/\u56db\u89d2\u661f.png",mode:"aspectFill"})}),(0,p.jsx)(t.EY,{className:"category-name",children:e.name}),(0,p.jsx)(t.EY,{className:"category-desc",children:e.desc}),(0,p.jsxs)(t.EY,{className:"category-price",children:["\xa5",e.price," \u8d77"]})]},e.id)})}),0===S.length&&(0,p.jsxs)(t.Ss,{className:"empty-category dashed-card",children:[(0,p.jsx)(t._V,{className:"empty-icon-img",src:"/icon/\u641c\u7d22.png",mode:"aspectFit"}),(0,p.jsx)(t.EY,{className:"empty-text",children:"\u672a\u627e\u5230\u5339\u914d\u7684\u54c1\u7c7b"}),(0,p.jsx)(t.EY,{className:"empty-sub",children:"\u5c1d\u8bd5\u641c\u7d22\u201c\u7b14\u8bb0\u672c\u201d\u3001\u201c\u676f\u57ab\u201d\u7b49"})]})]}),(0,p.jsx)(t.Ss,{className:"safe-bottom-placeholder"})]})]})}var N={navigationStyle:"custom",enablePageMeta:!0,navigationBarTitleText:"\u667a\u7ed8\u5fae\u523b"};Page((0,c.createPageConfig)(u,"pages/index/index",{root:{cn:[]}},N||{}))}},function(e){var s=function(s){return e(e.s=s)};e.O(0,[907,96,76],function(){return s(7265)});e.O()}]); \ No newline at end of file +"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[421],{7265:function(e,s,a){var c=a(7842),i=a(5544),t=a(118),r=a(758),n=a.n(r),l=a(6540),o=a(5234),m=a(8199),d=a(9703),h=a(9201),g=a(5414),p=a(9674),x=a(4848),j=[{title:"\u6bd5\u4e1a\u7eaa\u5ff5\u7b14\u8bb0\u672c",desc:"\u5168\u73ed\u540d\u5b57\u7ec4\u6210\u6821\u5fbd",image:(0,m.uq)("/img/book_small/The1.jpg")},{title:"\u94dc\u8d28\u676f\u57ab",desc:"\u91d1\u5c5e\u8d28\u611f\u684c\u9762\u827a\u672f",image:(0,m.uq)("/img/cup/The1.jpg")},{title:"\u7af9\u5236\u7b14\u76d2",desc:"\u81ea\u7136\u7af9\u7eb9\u6587\u623f\u96c5\u5668",image:(0,m.uq)("/img/penbox/The1.jpg")},{title:"\u4e66\u672c\u578b\u706f",desc:"\u6e29\u6696\u5149\u5f71\u70b9\u4eae\u5fc3\u610f",image:(0,m.uq)("/img/booklight/The1.jpg")},{title:"\u60c5\u4fa3\u5b9a\u5236\u793c",desc:"\u4e24\u4e2a\u4eba\u7684\u540d\u5b57\u4ea4\u7ec7",image:(0,m.uq)("/img/book_big/The1.jpg")},{title:"\u4f01\u4e1a\u5e74\u4f1a\u793c",desc:"\u5458\u5de5\u540d\u5b57\u7ec4\u6210Logo",image:(0,m.uq)("/img/penbox/The2.jpg")}],u={"notebook-small":(0,m.uq)("/img/book_small/The1.jpg"),"notebook-large":(0,m.uq)("/img/book_big/The1.jpg"),coaster:(0,m.uq)("/img/cup/The1.jpg"),penbox:(0,m.uq)("/img/penbox/The1.jpg"),booklamp:(0,m.uq)("/img/booklight/The1.jpg")};function N(){var e=(0,d.wR)(),s=(e.theme,e.resolvedTheme),a=(0,h.c)();(0,g.l)(s);var c=(0,l.useState)(""),r=(0,i.A)(c,2),m=r[0],N=r[1],b=function(e){n().navigateTo({url:"/pages/product/index?id=".concat(e)})},S=m.trim()?o.R6.filter(function(e){return e.name.includes(m)||e.desc.includes(m)}):o.R6,w=function(e){N(e.detail.value)};return(0,x.jsxs)(t.Ss,{className:"theme-".concat(s),children:[(0,x.jsx)(p.A,{}),(0,x.jsxs)(t.Ss,{className:"index-page",children:[(0,x.jsx)(t.Ss,{className:"header-bar",style:{paddingTop:"".concat(a.headerPaddingTop,"px")},children:(0,x.jsx)(t.EY,{className:"header-title",children:"\u667a\u7ed8\u5fae\u523b"})}),(0,x.jsxs)(t.Ss,{className:"search-card dashed-card",children:[(0,x.jsx)(t.Ss,{className:"star-badge"}),(0,x.jsxs)(t.Ss,{className:"search-inner",children:[(0,x.jsx)(t._V,{className:"search-icon-img",src:"/icon/\u641c\u7d22.png",mode:"aspectFit"}),(0,x.jsx)(t.pd,{className:"search-input",type:"text",placeholder:"\u641c\u7d22\u5b9a\u5236\u54c1\u7c7b\uff1a\u7b14\u8bb0\u672c\u3001\u676f\u57ab\u3001\u4e66\u706f...",value:m,onInput:w,confirmType:"search"})]}),m.trim()&&(0,x.jsx)(t.Ss,{className:"search-result-hint",children:(0,x.jsx)(t.EY,{className:"hint-text",children:S.length>0?"\u627e\u5230 ".concat(S.length," \u4e2a\u76f8\u5173\u54c1\u7c7b"):"\u6ca1\u6709\u627e\u5230\u76f8\u5173\u54c1\u7c7b\uff0c\u8bd5\u8bd5\u770b\u5176\u4ed6\u5173\u952e\u8bcd"})})]}),(0,x.jsxs)(t.Ss,{className:"showcase-section mt-20",children:[(0,x.jsx)(t.EY,{className:"section-title",children:"\u5b9a\u5236\u6210\u54c1\u5c55\u793a"}),(0,x.jsx)(t.RC,{className:"showcase-swiper",indicatorColor:"#e0e0e0",indicatorActiveColor:"#ff9a9e",circular:!0,autoplay:!0,interval:3e3,duration:500,previousMargin:"40rpx",nextMargin:"40rpx",indicatorDots:!0,children:j.map(function(e,s){return(0,x.jsx)(t.wu,{className:"showcase-swiper-item",children:(0,x.jsxs)(t.Ss,{className:"showcase-swiper-card dashed-card",children:[(0,x.jsx)(t.Ss,{className:"star-badge"}),(0,x.jsx)(t.Ss,{className:"showcase-image-wrapper",children:(0,x.jsx)(t._V,{className:"showcase-real-img",src:e.image,mode:"aspectFill"})}),(0,x.jsxs)(t.Ss,{className:"showcase-text-area",children:[(0,x.jsxs)(t.Ss,{className:"showcase-info",children:[(0,x.jsx)(t.EY,{className:"showcase-title",children:e.title}),(0,x.jsx)(t.EY,{className:"showcase-desc",children:e.desc})]}),(0,x.jsx)(t.Ss,{className:"showcase-tag",children:"\u6210\u54c1\u6848\u4f8b"})]})]})},s)})})]}),(0,x.jsxs)(t.Ss,{className:"category-section mt-20",children:[(0,x.jsx)(t.EY,{className:"section-title",children:"\u70ed\u95e8\u54c1\u7c7b"}),(0,x.jsx)(t.Ss,{className:"category-grid",children:S.map(function(e){return(0,x.jsxs)(t.Ss,{className:"category-item dashed-card",onTap:function(){return b(e.id)},children:[(0,x.jsx)(t.Ss,{className:"star-badge"}),(0,x.jsx)(t.Ss,{className:"category-img-wrapper",children:(0,x.jsx)(t._V,{className:"category-img-real",src:u[e.id]||"/icon/\u56db\u89d2\u661f.png",mode:"aspectFill"})}),(0,x.jsx)(t.EY,{className:"category-name",children:e.name}),(0,x.jsx)(t.EY,{className:"category-desc",children:e.desc}),(0,x.jsxs)(t.EY,{className:"category-price",children:["\xa5",e.price," \u8d77"]})]},e.id)})}),0===S.length&&(0,x.jsxs)(t.Ss,{className:"empty-category dashed-card",children:[(0,x.jsx)(t._V,{className:"empty-icon-img",src:"/icon/\u641c\u7d22.png",mode:"aspectFit"}),(0,x.jsx)(t.EY,{className:"empty-text",children:"\u672a\u627e\u5230\u5339\u914d\u7684\u54c1\u7c7b"}),(0,x.jsx)(t.EY,{className:"empty-sub",children:"\u5c1d\u8bd5\u641c\u7d22\u201c\u7b14\u8bb0\u672c\u201d\u3001\u201c\u676f\u57ab\u201d\u7b49"})]})]}),(0,x.jsx)(t.Ss,{className:"safe-bottom-placeholder"})]})]})}var b={navigationStyle:"custom",enablePageMeta:!0,navigationBarTitleText:"\u667a\u7ed8\u5fae\u523b"};Page((0,c.createPageConfig)(N,"pages/index/index",{root:{cn:[]}},b||{}))}},function(e){var s=function(s){return e(e.s=s)};e.O(0,[907,96,76],function(){return s(7265)});e.O()}]); \ No newline at end of file diff --git a/dist/pages/orderDetail/index.js b/dist/pages/orderDetail/index.js index 36243a7..51e5d20 100644 --- a/dist/pages/orderDetail/index.js +++ b/dist/pages/orderDetail/index.js @@ -1 +1 @@ -"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[154],{6382:function(s,e,a){var c=a(7842),d=a(9379),l=a(5544),i=a(118),n=a(758),r=a.n(n),t=a(6540),m=a(9703),o=a(9201),h=a(5414),x=a(9674),j=a(8594),N=a(4848);function u(){var s,e,a,c=(0,m.wR)(),n=(c.theme,c.resolvedTheme),u=(0,o.c)();(0,h.l)(n);var p=null===(s=r().getCurrentInstance().router)||void 0===s?void 0:s.params,S=(null===p||void 0===p?void 0:p.orderId)||"",g=(0,t.useState)(null),E=(0,l.A)(g,2),Y=E[0],v=E[1],f=(0,t.useState)(null),k=(0,l.A)(f,2),b=k[0],w=k[1],T=(0,t.useState)(!1),C=(0,l.A)(T,2),y=C[0],A=C[1],I=(0,t.useState)([]),P=(0,l.A)(I,2),F=P[0],B=P[1];(0,t.useEffect)(function(){var s=(0,j.n7)(),e=s.find(function(s){return s.id===S});e&&(v(e),e.address?w(e.address):w((0,j.EB)())),B((0,j.Re)())},[S]);var V=function(s){w(s),A(!1);var e=(0,j.n7)(),a=e.findIndex(function(s){return s.id===S});a>=0&&(e[a]=(0,d.A)((0,d.A)({},e[a]),{},{address:s})),r().showToast({title:"\u5730\u5740\u5df2\u66f4\u6539",icon:"success"})};return Y?(0,N.jsxs)(i.Ss,{className:"theme-".concat(n),children:[(0,N.jsx)(x.A,{}),(0,N.jsxs)(i.Ss,{className:"order-detail-page",children:[(0,N.jsxs)(i.Ss,{className:"page-header dashed-card mt-20",style:{marginTop:"".concat(u.headerPaddingTop,"px")},children:[(0,N.jsx)(i.Ss,{className:"star-badge"}),(0,N.jsxs)(i.Ss,{className:"flex-between",style:{width:"100%"},children:[(0,N.jsx)(i.EY,{className:"back-btn",onTap:function(){return r().navigateBack()},children:"\u2190"}),(0,N.jsx)(i.EY,{className:"page-title",children:"\u8ba2\u5355\u8be6\u60c5"}),(0,N.jsx)(i.Ss,{style:{width:"60px"}})]})]}),(0,N.jsxs)(i.Ss,{className:"status-banner dashed-card mt-20",children:[(0,N.jsx)(i.Ss,{className:"star-badge"}),(0,N.jsxs)(i.EY,{className:"status-text",children:["pending"===Y.statusCode&&"\u5f85\u4ed8\u6b3e","paid"===Y.statusCode&&"\u5f85\u53d1\u8d27","shipping"===Y.statusCode&&"\u5f85\u6536\u8d27","done"===Y.statusCode&&"\u5df2\u5b8c\u6210"]}),(0,N.jsxs)(i.EY,{className:"status-desc",children:["pending"===Y.statusCode&&"\u8bf7\u572830\u5206\u949f\u5185\u5b8c\u6210\u652f\u4ed8","paid"===Y.statusCode&&"\u5546\u54c1\u6b63\u5728\u6253\u5305\u4e2d\uff0c\u5373\u5c06\u53d1\u8d27","shipping"===Y.statusCode&&"\u5feb\u9012\u8fd0\u8f93\u4e2d\uff0c\u8bf7\u6ce8\u610f\u67e5\u6536","done"===Y.statusCode&&"\u4ea4\u6613\u5df2\u5b8c\u6210\uff0c\u611f\u8c22\u60e0\u987e"]})]}),("shipping"===Y.statusCode||"done"===Y.statusCode)&&(0,N.jsxs)(i.Ss,{className:"logistics-card dashed-card mt-20",children:[(0,N.jsx)(i.Ss,{className:"star-badge"}),(0,N.jsxs)(i.Ss,{className:"logistics-header",children:[(0,N.jsxs)(i.Ss,{className:"flex-center",children:[(0,N.jsx)(i._V,{className:"card-icon-img",src:"/icon/\u5305\u88f9.png",mode:"aspectFit"}),(0,N.jsx)(i.EY,{className:"logistics-title",children:"\u7269\u6d41\u4fe1\u606f"})]}),(0,N.jsx)(i.EY,{className:"logistics-num",children:"\u5355\u53f7: SF1234567890"})]}),(0,N.jsxs)(i.Ss,{className:"timeline",children:[(0,N.jsxs)(i.Ss,{className:"timeline-item active",children:[(0,N.jsx)(i.Ss,{className:"timeline-dot"}),(0,N.jsxs)(i.Ss,{className:"timeline-content",children:[(0,N.jsx)(i.EY,{className:"timeline-status",children:"\u8fd0\u8f93\u4e2d"}),(0,N.jsx)(i.EY,{className:"timeline-time",children:"2024-01-15 14:30"}),(0,N.jsx)(i.EY,{className:"timeline-desc",children:"\u3010\u5317\u4eac\u5e02\u3011\u5feb\u4ef6\u5df2\u5230\u8fbe\u5317\u4eac\u671d\u9633\u8f6c\u8fd0\u4e2d\u5fc3"})]})]}),(0,N.jsxs)(i.Ss,{className:"timeline-item",children:[(0,N.jsx)(i.Ss,{className:"timeline-dot"}),(0,N.jsxs)(i.Ss,{className:"timeline-content",children:[(0,N.jsx)(i.EY,{className:"timeline-status",children:"\u5df2\u53d1\u8d27"}),(0,N.jsx)(i.EY,{className:"timeline-time",children:"2024-01-15 09:00"}),(0,N.jsx)(i.EY,{className:"timeline-desc",children:"\u3010\u6df1\u5733\u5e02\u3011\u5546\u5bb6\u5df2\u53d1\u8d27\uff0c\u7b49\u5f85\u63fd\u6536"})]})]}),(0,N.jsxs)(i.Ss,{className:"timeline-item",children:[(0,N.jsx)(i.Ss,{className:"timeline-dot"}),(0,N.jsxs)(i.Ss,{className:"timeline-content",children:[(0,N.jsx)(i.EY,{className:"timeline-status",children:"\u5df2\u4e0b\u5355"}),(0,N.jsx)(i.EY,{className:"timeline-time",children:"2024-01-14 20:15"}),(0,N.jsx)(i.EY,{className:"timeline-desc",children:"\u8ba2\u5355\u5df2\u751f\u6210\uff0c\u7b49\u5f85\u5546\u5bb6\u53d1\u8d27"})]})]})]})]}),(0,N.jsxs)(i.Ss,{className:"product-card dashed-card mt-20",children:[(0,N.jsx)(i.Ss,{className:"star-badge"}),(0,N.jsxs)(i.Ss,{className:"product-row",children:[(0,N.jsx)(i.Ss,{className:"product-icon-wrapper",children:(0,N.jsx)(i._V,{className:"product-icon-img",src:null!==(e=Y.productIcon)&&void 0!==e&&e.startsWith("/icon/")?Y.productIcon:"/icon/\u56db\u89d2\u661f.png",mode:"aspectFit"})}),(0,N.jsxs)(i.Ss,{className:"product-info",children:[(0,N.jsx)(i.EY,{className:"product-name",children:Y.productName}),(0,N.jsx)(i.EY,{className:"product-sku",children:Y.sku})]})]}),(0,N.jsxs)(i.Ss,{className:"price-row",children:[(0,N.jsx)(i.EY,{className:"price-label",children:"\u5b9e\u4ed8\u6b3e"}),(0,N.jsx)(i.EY,{className:"price-value",children:Y.price})]})]}),(0,N.jsxs)(i.Ss,{className:"address-card dashed-card mt-20",children:[(0,N.jsx)(i.Ss,{className:"star-badge"}),(0,N.jsxs)(i.Ss,{className:"address-header",children:[(0,N.jsxs)(i.Ss,{className:"flex-center",children:[(0,N.jsx)(i._V,{className:"card-icon-img",src:"/icon/\u5730\u5740.png",mode:"aspectFit"}),(0,N.jsx)(i.EY,{className:"address-title",children:"\u6536\u8d27\u5730\u5740"})]}),(0,N.jsx)(i.Ss,{className:"address-change",onTap:function(){return A(!0)},children:(0,N.jsx)(i.EY,{className:"change-text",children:"\u66f4\u6539\u6536\u8d27\u5730\u5740"})})]}),b?(0,N.jsxs)(i.Ss,{className:"address-body",children:[(0,N.jsxs)(i.Ss,{className:"address-row",children:[(0,N.jsx)(i.EY,{className:"address-name",children:b.name}),(0,N.jsx)(i.EY,{className:"address-phone",children:b.phone})]}),(0,N.jsxs)(i.EY,{className:"address-detail",children:[null===(a=b.region)||void 0===a?void 0:a.join(" ")," ",b.detail]})]}):(0,N.jsx)(i.Ss,{className:"address-empty",children:(0,N.jsx)(i.EY,{children:"\u6682\u65e0\u6536\u8d27\u5730\u5740\uff0c\u8bf7\u5148\u6dfb\u52a0"})})]}),(0,N.jsxs)(i.Ss,{className:"meta-card dashed-card mt-20",children:[(0,N.jsx)(i.Ss,{className:"star-badge"}),(0,N.jsx)(i.EY,{className:"meta-title",children:"\u8ba2\u5355\u4fe1\u606f"}),(0,N.jsxs)(i.Ss,{className:"meta-row",children:[(0,N.jsx)(i.EY,{className:"meta-label",children:"\u8ba2\u5355\u7f16\u53f7"}),(0,N.jsx)(i.EY,{className:"meta-value",children:Y.id})]}),(0,N.jsxs)(i.Ss,{className:"meta-row",children:[(0,N.jsx)(i.EY,{className:"meta-label",children:"\u521b\u5efa\u65f6\u95f4"}),(0,N.jsx)(i.EY,{className:"meta-value",children:Y.date})]}),(0,N.jsxs)(i.Ss,{className:"meta-row",children:[(0,N.jsx)(i.EY,{className:"meta-label",children:"\u6570\u91cf"}),(0,N.jsxs)(i.EY,{className:"meta-value",children:[Y.count," \u4ef6"]})]})]}),(0,N.jsx)(i.Ss,{style:{height:"40px"}}),y&&(0,N.jsx)(i.Ss,{className:"modal-overlay",style:{alignItems:"flex-end",justifyContent:"flex-end"},children:(0,N.jsxs)(i.Ss,{className:"addr-picker-sheet dashed-card",children:[(0,N.jsxs)(i.Ss,{className:"addr-picker-header",children:[(0,N.jsx)(i.EY,{className:"addr-picker-title",children:"\u9009\u62e9\u6536\u8d27\u5730\u5740"}),(0,N.jsx)(i.EY,{className:"addr-picker-close",onTap:function(){return A(!1)},children:"\u2715"})]}),(0,N.jsxs)(i.Ss,{className:"addr-picker-list",children:[F.map(function(s){var e;return(0,N.jsxs)(i.Ss,{className:"addr-picker-item ".concat((null===b||void 0===b?void 0:b.id)===s.id?"active":""),onTap:function(){return V(s)},children:[(0,N.jsxs)(i.Ss,{className:"addr-picker-row",children:[(0,N.jsx)(i.EY,{className:"addr-picker-name",children:s.name}),(0,N.jsx)(i.EY,{className:"addr-picker-phone",children:s.phone}),s.isDefault&&(0,N.jsx)(i.EY,{className:"addr-picker-default",children:"\u9ed8\u8ba4"})]}),(0,N.jsxs)(i.EY,{className:"addr-picker-detail",children:[null===(e=s.region)||void 0===e?void 0:e.join(" ")," ",s.detail]})]},s.id)}),0===F.length&&(0,N.jsx)(i.Ss,{className:"addr-picker-empty",children:(0,N.jsx)(i.EY,{children:"\u6682\u65e0\u5730\u5740\uff0c\u8bf7\u5148\u6dfb\u52a0\u6536\u8d27\u5730\u5740"})})]}),(0,N.jsx)(i.Ss,{className:"addr-picker-add",onTap:function(){A(!1),r().navigateTo({url:"/pages/address/index"})},children:(0,N.jsx)(i.EY,{className:"addr-picker-add-text",children:"+ \u65b0\u5efa\u6536\u8d27\u5730\u5740"})})]})})]})]}):(0,N.jsxs)(i.Ss,{className:"theme-".concat(n),children:[(0,N.jsx)(x.A,{}),(0,N.jsx)(i.Ss,{className:"order-detail-page",children:(0,N.jsx)(i.Ss,{className:"page-header dashed-card mt-20",style:{marginTop:"".concat(u.headerPaddingTop,"px")},children:(0,N.jsx)(i.EY,{className:"page-title",children:"\u8ba2\u5355\u4e0d\u5b58\u5728"})})})]})}var p={navigationStyle:"custom",enablePageMeta:!0,navigationBarTitleText:"\u8ba2\u5355\u8be6\u60c5"};Page((0,c.createPageConfig)(u,"pages/orderDetail/index",{root:{cn:[]}},p||{}))}},function(s){var e=function(e){return s(s.s=e)};s.O(0,[907,96,76],function(){return e(6382)});s.O()}]); \ No newline at end of file +"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[154],{6382:function(s,e,a){var c=a(7842),d=a(9379),l=a(5544),i=a(118),n=a(758),r=a.n(n),t=a(6540),m=a(9703),o=a(9201),h=a(5414),x=a(9674),j=a(8594),N=a(5234),u=a(8199),p=a(4848);function S(){var s,e,a,c=(0,m.wR)(),n=(c.theme,c.resolvedTheme),S=(0,o.c)();(0,h.l)(n);var g=null===(s=r().getCurrentInstance().router)||void 0===s?void 0:s.params,E=(null===g||void 0===g?void 0:g.orderId)||"",Y=(0,t.useState)(null),v=(0,l.A)(Y,2),f=v[0],k=v[1],b=(0,t.useState)(null),w=(0,l.A)(b,2),T=w[0],C=w[1],y=(0,t.useState)(!1),A=(0,l.A)(y,2),I=A[0],P=A[1],F=(0,t.useState)([]),B=(0,l.A)(F,2),V=B[0],_=B[1];(0,t.useEffect)(function(){var s=(0,j.n7)(),e=s.find(function(s){return s.id===E});e&&(k(e),e.address?C(e.address):C((0,j.EB)())),_((0,j.Re)())},[E]);var D=function(s){C(s),P(!1);var e=(0,j.n7)(),a=e.findIndex(function(s){return s.id===E});a>=0&&(e[a]=(0,d.A)((0,d.A)({},e[a]),{},{address:s})),r().showToast({title:"\u5730\u5740\u5df2\u66f4\u6539",icon:"success"})};return f?(0,p.jsxs)(i.Ss,{className:"theme-".concat(n),children:[(0,p.jsx)(x.A,{}),(0,p.jsxs)(i.Ss,{className:"order-detail-page",children:[(0,p.jsxs)(i.Ss,{className:"page-header dashed-card mt-20",style:{marginTop:"".concat(S.headerPaddingTop,"px")},children:[(0,p.jsx)(i.Ss,{className:"star-badge"}),(0,p.jsxs)(i.Ss,{className:"flex-between",style:{width:"100%"},children:[(0,p.jsx)(i.EY,{className:"back-btn",onTap:function(){return r().navigateBack()},children:"\u2190"}),(0,p.jsx)(i.EY,{className:"page-title",children:"\u8ba2\u5355\u8be6\u60c5"}),(0,p.jsx)(i.Ss,{style:{width:"60px"}})]})]}),(0,p.jsxs)(i.Ss,{className:"status-banner dashed-card mt-20",children:[(0,p.jsx)(i.Ss,{className:"star-badge"}),(0,p.jsxs)(i.EY,{className:"status-text",children:["pending"===f.statusCode&&"\u5f85\u4ed8\u6b3e","paid"===f.statusCode&&"\u5f85\u53d1\u8d27","shipping"===f.statusCode&&"\u5f85\u6536\u8d27","done"===f.statusCode&&"\u5df2\u5b8c\u6210"]}),(0,p.jsxs)(i.EY,{className:"status-desc",children:["pending"===f.statusCode&&"\u8bf7\u572830\u5206\u949f\u5185\u5b8c\u6210\u652f\u4ed8","paid"===f.statusCode&&"\u5546\u54c1\u6b63\u5728\u6253\u5305\u4e2d\uff0c\u5373\u5c06\u53d1\u8d27","shipping"===f.statusCode&&"\u5feb\u9012\u8fd0\u8f93\u4e2d\uff0c\u8bf7\u6ce8\u610f\u67e5\u6536","done"===f.statusCode&&"\u4ea4\u6613\u5df2\u5b8c\u6210\uff0c\u611f\u8c22\u60e0\u987e"]})]}),("shipping"===f.statusCode||"done"===f.statusCode)&&(0,p.jsxs)(i.Ss,{className:"logistics-card dashed-card mt-20",children:[(0,p.jsx)(i.Ss,{className:"star-badge"}),(0,p.jsxs)(i.Ss,{className:"logistics-header",children:[(0,p.jsxs)(i.Ss,{className:"flex-center",children:[(0,p.jsx)(i._V,{className:"card-icon-img",src:"/icon/\u5305\u88f9.png",mode:"aspectFit"}),(0,p.jsx)(i.EY,{className:"logistics-title",children:"\u7269\u6d41\u4fe1\u606f"})]}),(0,p.jsx)(i.EY,{className:"logistics-num",children:"\u5355\u53f7: SF1234567890"})]}),(0,p.jsxs)(i.Ss,{className:"timeline",children:[(0,p.jsxs)(i.Ss,{className:"timeline-item active",children:[(0,p.jsx)(i.Ss,{className:"timeline-dot"}),(0,p.jsxs)(i.Ss,{className:"timeline-content",children:[(0,p.jsx)(i.EY,{className:"timeline-status",children:"\u8fd0\u8f93\u4e2d"}),(0,p.jsx)(i.EY,{className:"timeline-time",children:"2024-01-15 14:30"}),(0,p.jsx)(i.EY,{className:"timeline-desc",children:"\u3010\u5317\u4eac\u5e02\u3011\u5feb\u4ef6\u5df2\u5230\u8fbe\u5317\u4eac\u671d\u9633\u8f6c\u8fd0\u4e2d\u5fc3"})]})]}),(0,p.jsxs)(i.Ss,{className:"timeline-item",children:[(0,p.jsx)(i.Ss,{className:"timeline-dot"}),(0,p.jsxs)(i.Ss,{className:"timeline-content",children:[(0,p.jsx)(i.EY,{className:"timeline-status",children:"\u5df2\u53d1\u8d27"}),(0,p.jsx)(i.EY,{className:"timeline-time",children:"2024-01-15 09:00"}),(0,p.jsx)(i.EY,{className:"timeline-desc",children:"\u3010\u6df1\u5733\u5e02\u3011\u5546\u5bb6\u5df2\u53d1\u8d27\uff0c\u7b49\u5f85\u63fd\u6536"})]})]}),(0,p.jsxs)(i.Ss,{className:"timeline-item",children:[(0,p.jsx)(i.Ss,{className:"timeline-dot"}),(0,p.jsxs)(i.Ss,{className:"timeline-content",children:[(0,p.jsx)(i.EY,{className:"timeline-status",children:"\u5df2\u4e0b\u5355"}),(0,p.jsx)(i.EY,{className:"timeline-time",children:"2024-01-14 20:15"}),(0,p.jsx)(i.EY,{className:"timeline-desc",children:"\u8ba2\u5355\u5df2\u751f\u6210\uff0c\u7b49\u5f85\u5546\u5bb6\u53d1\u8d27"})]})]})]})]}),(0,p.jsxs)(i.Ss,{className:"product-card dashed-card mt-20",children:[(0,p.jsx)(i.Ss,{className:"star-badge"}),(0,p.jsxs)(i.Ss,{className:"product-row",children:[(0,p.jsx)(i.Ss,{className:"product-icon-wrapper",children:(0,p.jsx)(i._V,{className:"product-icon-img",src:(0,u.uq)(null!==(e=f.productIcon)&&void 0!==e&&e.startsWith("/icon/")||/^https?:/i.test(f.productIcon||"")?f.productIcon:N.rj[f.productId]||"/icon/\u56db\u89d2\u661f.png"),mode:"aspectFit"})}),(0,p.jsxs)(i.Ss,{className:"product-info",children:[(0,p.jsx)(i.EY,{className:"product-name",children:f.productName}),(0,p.jsx)(i.EY,{className:"product-sku",children:f.sku})]})]}),(0,p.jsxs)(i.Ss,{className:"price-row",children:[(0,p.jsx)(i.EY,{className:"price-label",children:"\u5b9e\u4ed8\u6b3e"}),(0,p.jsx)(i.EY,{className:"price-value",children:f.price})]})]}),(0,p.jsxs)(i.Ss,{className:"address-card dashed-card mt-20",children:[(0,p.jsx)(i.Ss,{className:"star-badge"}),(0,p.jsxs)(i.Ss,{className:"address-header",children:[(0,p.jsxs)(i.Ss,{className:"flex-center",children:[(0,p.jsx)(i._V,{className:"card-icon-img",src:"/icon/\u5730\u5740.png",mode:"aspectFit"}),(0,p.jsx)(i.EY,{className:"address-title",children:"\u6536\u8d27\u5730\u5740"})]}),(0,p.jsx)(i.Ss,{className:"address-change",onTap:function(){return P(!0)},children:(0,p.jsx)(i.EY,{className:"change-text",children:"\u66f4\u6539\u6536\u8d27\u5730\u5740"})})]}),T?(0,p.jsxs)(i.Ss,{className:"address-body",children:[(0,p.jsxs)(i.Ss,{className:"address-row",children:[(0,p.jsx)(i.EY,{className:"address-name",children:T.name}),(0,p.jsx)(i.EY,{className:"address-phone",children:T.phone})]}),(0,p.jsxs)(i.EY,{className:"address-detail",children:[null===(a=T.region)||void 0===a?void 0:a.join(" ")," ",T.detail]})]}):(0,p.jsx)(i.Ss,{className:"address-empty",children:(0,p.jsx)(i.EY,{children:"\u6682\u65e0\u6536\u8d27\u5730\u5740\uff0c\u8bf7\u5148\u6dfb\u52a0"})})]}),(0,p.jsxs)(i.Ss,{className:"meta-card dashed-card mt-20",children:[(0,p.jsx)(i.Ss,{className:"star-badge"}),(0,p.jsx)(i.EY,{className:"meta-title",children:"\u8ba2\u5355\u4fe1\u606f"}),(0,p.jsxs)(i.Ss,{className:"meta-row",children:[(0,p.jsx)(i.EY,{className:"meta-label",children:"\u8ba2\u5355\u7f16\u53f7"}),(0,p.jsx)(i.EY,{className:"meta-value",children:f.id})]}),(0,p.jsxs)(i.Ss,{className:"meta-row",children:[(0,p.jsx)(i.EY,{className:"meta-label",children:"\u521b\u5efa\u65f6\u95f4"}),(0,p.jsx)(i.EY,{className:"meta-value",children:f.date})]}),(0,p.jsxs)(i.Ss,{className:"meta-row",children:[(0,p.jsx)(i.EY,{className:"meta-label",children:"\u6570\u91cf"}),(0,p.jsxs)(i.EY,{className:"meta-value",children:[f.count," \u4ef6"]})]})]}),(0,p.jsx)(i.Ss,{style:{height:"40px"}}),I&&(0,p.jsx)(i.Ss,{className:"modal-overlay",style:{alignItems:"flex-end",justifyContent:"flex-end"},children:(0,p.jsxs)(i.Ss,{className:"addr-picker-sheet dashed-card",children:[(0,p.jsxs)(i.Ss,{className:"addr-picker-header",children:[(0,p.jsx)(i.EY,{className:"addr-picker-title",children:"\u9009\u62e9\u6536\u8d27\u5730\u5740"}),(0,p.jsx)(i.EY,{className:"addr-picker-close",onTap:function(){return P(!1)},children:"\u2715"})]}),(0,p.jsxs)(i.Ss,{className:"addr-picker-list",children:[V.map(function(s){var e;return(0,p.jsxs)(i.Ss,{className:"addr-picker-item ".concat((null===T||void 0===T?void 0:T.id)===s.id?"active":""),onTap:function(){return D(s)},children:[(0,p.jsxs)(i.Ss,{className:"addr-picker-row",children:[(0,p.jsx)(i.EY,{className:"addr-picker-name",children:s.name}),(0,p.jsx)(i.EY,{className:"addr-picker-phone",children:s.phone}),s.isDefault&&(0,p.jsx)(i.EY,{className:"addr-picker-default",children:"\u9ed8\u8ba4"})]}),(0,p.jsxs)(i.EY,{className:"addr-picker-detail",children:[null===(e=s.region)||void 0===e?void 0:e.join(" ")," ",s.detail]})]},s.id)}),0===V.length&&(0,p.jsx)(i.Ss,{className:"addr-picker-empty",children:(0,p.jsx)(i.EY,{children:"\u6682\u65e0\u5730\u5740\uff0c\u8bf7\u5148\u6dfb\u52a0\u6536\u8d27\u5730\u5740"})})]}),(0,p.jsx)(i.Ss,{className:"addr-picker-add",onTap:function(){P(!1),r().navigateTo({url:"/pages/address/index"})},children:(0,p.jsx)(i.EY,{className:"addr-picker-add-text",children:"+ \u65b0\u5efa\u6536\u8d27\u5730\u5740"})})]})})]})]}):(0,p.jsxs)(i.Ss,{className:"theme-".concat(n),children:[(0,p.jsx)(x.A,{}),(0,p.jsx)(i.Ss,{className:"order-detail-page",children:(0,p.jsx)(i.Ss,{className:"page-header dashed-card mt-20",style:{marginTop:"".concat(S.headerPaddingTop,"px")},children:(0,p.jsx)(i.EY,{className:"page-title",children:"\u8ba2\u5355\u4e0d\u5b58\u5728"})})})]})}var g={navigationStyle:"custom",enablePageMeta:!0,navigationBarTitleText:"\u8ba2\u5355\u8be6\u60c5"};Page((0,c.createPageConfig)(S,"pages/orderDetail/index",{root:{cn:[]}},g||{}))}},function(s){var e=function(e){return s(s.s=e)};s.O(0,[907,96,76],function(){return e(6382)});s.O()}]); \ No newline at end of file diff --git a/dist/pages/orders/index.js b/dist/pages/orders/index.js index 9bea048..1ce9c4b 100644 --- a/dist/pages/orders/index.js +++ b/dist/pages/orders/index.js @@ -1 +1 @@ -"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[402],{2307:function(e,s,a){var n=a(7842),r=a(5544),c=a(118),t=a(758),l=a.n(t),o=a(6540),i=a(8594),d=a(9703),u=a(9201),h=a(5414),p=a(7723),m=a(9674),x=a(4848),g=[{code:"all",label:"\u5168\u90e8"},{code:"pending",label:"\u5f85\u4ed8\u6b3e"},{code:"paid",label:"\u5f85\u53d1\u8d27"},{code:"shipping",label:"\u5f85\u6536\u8d27"},{code:"done",label:"\u5df2\u5b8c\u6210"}],b={pending:{label:"\u5f85\u4ed8\u6b3e",badge:"badge-pink"},paid:{label:"\u5f85\u53d1\u8d27",badge:"badge-blue"},shipping:{label:"\u5f85\u6536\u8d27",badge:"badge-blue"},done:{label:"\u5df2\u5b8c\u6210",badge:"badge-green"},cancelled:{label:"\u5df2\u53d6\u6d88",badge:"badge-gray"}};function j(){var e=(0,d.wR)(),s=(e.theme,e.resolvedTheme),a=(0,u.c)();(0,h.l)(s);var n=(0,o.useState)("all"),t=(0,r.A)(n,2),j=t[0],f=t[1],N=(0,o.useState)([]),S=(0,r.A)(N,2),v=S[0],E=S[1],Y=function(){return E((0,i.n7)())};(0,o.useEffect)(Y,[]),(0,o.useEffect)(function(){var e=function(){var e=l().getStorageSync("orders:filter");e&&g.some(function(s){return s.code===e})&&(f(e),l().removeStorageSync("orders:filter")),Y()};e();var s=l().getCurrentInstance().page;if(s){var a=s.onShow;s.onShow=function(){e(),a&&a.apply(this)}}},[]),(0,o.useEffect)(function(){var e,s;return null===(e=l().eventCenter)||void 0===e||null===(s=e.once)||void 0===s||s.call(e,"orders:refresh",Y),Y(),function(){var e,s;null===(e=l().eventCenter)||void 0===e||null===(s=e.off)||void 0===s||s.call(e,"orders:refresh",Y)}},[]);var T="all"===j?v:v.filter(function(e){return e.statusCode===j}),w=function(e){l().navigateTo({url:"/pages/orderDetail/index?orderId=".concat(e.id)})};return(0,x.jsxs)(c.Ss,{className:"theme-".concat(s),children:[(0,x.jsx)(m.A,{}),(0,x.jsx)(p.A,{children:(0,x.jsxs)(c.Ss,{className:"orders-page",children:[(0,x.jsxs)(c.Ss,{className:"page-header dashed-card mt-20",style:{marginTop:"".concat(a.headerPaddingTop,"px")},children:[(0,x.jsx)(c.Ss,{className:"star-badge"}),(0,x.jsx)(c.EY,{className:"page-title",children:"\u6211\u7684\u8ba2\u5355"})]}),(0,x.jsx)(c.Ss,{className:"status-tabs",children:(0,x.jsx)(c.BM,{className:"tabs-scroll",scrollX:!0,children:g.map(function(e){return(0,x.jsxs)(c.Ss,{className:"tab-item ".concat(j===e.code?"active":""),onTap:function(){return f(e.code)},children:[(0,x.jsx)(c.EY,{className:"tab-label",children:e.label}),j===e.code&&(0,x.jsx)(c.Ss,{className:"tab-underline"})]},e.code)})})}),(0,x.jsxs)(c.BM,{className:"orders-list",scrollY:!0,children:[T.map(function(e){var s,a=b[e.statusCode]||b.pending,n=null!==(s=e.productIcon)&&void 0!==s&&s.startsWith("/icon/")?e.productIcon:"/icon/\u56db\u89d2\u661f.png";return(0,x.jsxs)(c.Ss,{className:"order-card dashed-card",onTap:function(){return w(e)},children:[(0,x.jsx)(c.Ss,{className:"star-badge"}),(0,x.jsxs)(c.Ss,{className:"order-header",children:[(0,x.jsx)(c.EY,{className:"order-date",children:e.date}),(0,x.jsx)(c.EY,{className:"badge ".concat(a.badge),children:a.label})]}),(0,x.jsxs)(c.Ss,{className:"order-body",children:[(0,x.jsx)(c.Ss,{className:"order-icon-wrapper",children:(0,x.jsx)(c._V,{className:"order-icon-img",src:n,mode:"aspectFit"})}),(0,x.jsxs)(c.Ss,{className:"order-info",children:[(0,x.jsx)(c.EY,{className:"order-product",children:e.productName}),(0,x.jsx)(c.EY,{className:"order-sku",children:e.sku}),(0,x.jsxs)(c.EY,{className:"order-meta",children:["\u6570\u91cf: ",e.count," \u4ef6 | ",e.id]})]})]}),(0,x.jsxs)(c.Ss,{className:"order-footer",children:[(0,x.jsxs)(c.Ss,{className:"order-price-bar",children:[(0,x.jsx)(c.EY,{className:"price-label",children:"\u5b9e\u4ed8\u6b3e"}),(0,x.jsx)(c.EY,{className:"price-value",children:e.price})]}),(0,x.jsxs)(c.Ss,{className:"order-actions",children:["pending"===e.statusCode&&(0,x.jsx)(c.Ss,{className:"btn-gradient order-btn",children:(0,x.jsx)(c.EY,{children:"\u7acb\u5373\u4ed8\u6b3e"})}),"paid"===e.statusCode&&(0,x.jsx)(c.Ss,{className:"btn-outline order-btn",children:(0,x.jsx)(c.EY,{children:"\u50ac\u53d1\u8d27"})}),"shipping"===e.statusCode&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(c.Ss,{className:"btn-outline order-btn",onTap:function(e){e.stopPropagation(),l().showToast({title:"\u67e5\u770b\u7269\u6d41",icon:"none"})},children:(0,x.jsx)(c.EY,{children:"\u67e5\u770b\u7269\u6d41"})}),(0,x.jsx)(c.Ss,{className:"btn-gradient order-btn",onTap:function(e){e.stopPropagation(),l().showToast({title:"\u786e\u8ba4\u6536\u8d27",icon:"none"})},children:(0,x.jsx)(c.EY,{children:"\u786e\u8ba4\u6536\u8d27"})})]}),"done"===e.statusCode&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(c.Ss,{className:"btn-outline order-btn",onTap:function(e){e.stopPropagation(),l().showToast({title:"\u7533\u8bf7\u552e\u540e",icon:"none"})},children:(0,x.jsx)(c.EY,{children:"\u7533\u8bf7\u552e\u540e"})}),(0,x.jsx)(c.Ss,{className:"btn-gradient order-btn",onTap:function(e){e.stopPropagation(),l().showToast({title:"\u518d\u6765\u4e00\u5355",icon:"none"})},children:(0,x.jsx)(c.EY,{children:"\u518d\u6765\u4e00\u5355"})})]}),(0,x.jsx)(c.Ss,{className:"btn-outline order-btn",onTap:function(s){s.stopPropagation(),w(e)},children:(0,x.jsx)(c.EY,{children:"\u8be6\u60c5"})})]})]})]},e.id)}),0===T.length&&(0,x.jsxs)(c.Ss,{className:"empty-state",children:[(0,x.jsx)(c._V,{className:"empty-icon-img",src:"/icon/\u5305\u88f9.png",mode:"aspectFit"}),(0,x.jsx)(c.EY,{className:"empty-text",children:"\u6682\u65e0\u8ba2\u5355"}),(0,x.jsx)(c.EY,{className:"empty-sub",children:"\u53bb\u9996\u9875\u5f00\u59cb\u5b9a\u5236\u5427"}),(0,x.jsx)(c.Ss,{className:"btn-gradient",onTap:function(){return l().switchTab({url:"/pages/index/index"})},children:(0,x.jsx)(c.EY,{children:"\u53bb\u5b9a\u5236"})})]})]}),(0,x.jsx)(c.Ss,{style:{height:"40px"}})]})})]})}var f={navigationStyle:"custom",enablePageMeta:!0,navigationBarTitleText:"\u8ba2\u5355\u5217\u8868"};Page((0,n.createPageConfig)(j,"pages/orders/index",{root:{cn:[]}},f||{}))}},function(e){var s=function(s){return e(e.s=s)};e.O(0,[907,96,76],function(){return s(2307)});e.O()}]); \ No newline at end of file +"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[402],{2307:function(e,s,a){var n=a(7842),r=a(5544),t=a(118),c=a(758),o=a.n(c),l=a(6540),i=a(8594),d=a(8199),u=a(9703),h=a(9201),p=a(5414),m=a(7723),x=a(9674),g=a(4848),b=[{code:"all",label:"\u5168\u90e8"},{code:"pending",label:"\u5f85\u4ed8\u6b3e"},{code:"paid",label:"\u5f85\u53d1\u8d27"},{code:"shipping",label:"\u5f85\u6536\u8d27"},{code:"done",label:"\u5df2\u5b8c\u6210"}],j={pending:{label:"\u5f85\u4ed8\u6b3e",badge:"badge-pink"},paid:{label:"\u5f85\u53d1\u8d27",badge:"badge-blue"},shipping:{label:"\u5f85\u6536\u8d27",badge:"badge-blue"},done:{label:"\u5df2\u5b8c\u6210",badge:"badge-green"},cancelled:{label:"\u5df2\u53d6\u6d88",badge:"badge-gray"}};function f(){var e=(0,u.wR)(),s=(e.theme,e.resolvedTheme),a=(0,h.c)();(0,p.l)(s);var n=(0,l.useState)("all"),c=(0,r.A)(n,2),f=c[0],N=c[1],S=(0,l.useState)([]),v=(0,r.A)(S,2),E=v[0],Y=v[1],T=function(){return Y((0,i.n7)())};(0,l.useEffect)(T,[]),(0,l.useEffect)(function(){var e=function(){var e=o().getStorageSync("orders:filter");e&&b.some(function(s){return s.code===e})&&(N(e),o().removeStorageSync("orders:filter")),T()};e();var s=o().getCurrentInstance().page;if(s){var a=s.onShow;s.onShow=function(){e(),a&&a.apply(this)}}},[]),(0,l.useEffect)(function(){var e,s;return null===(e=o().eventCenter)||void 0===e||null===(s=e.once)||void 0===s||s.call(e,"orders:refresh",T),T(),function(){var e,s;null===(e=o().eventCenter)||void 0===e||null===(s=e.off)||void 0===s||s.call(e,"orders:refresh",T)}},[]);var w="all"===f?E:E.filter(function(e){return e.statusCode===f}),y=function(e){o().navigateTo({url:"/pages/orderDetail/index?orderId=".concat(e.id)})};return(0,g.jsxs)(t.Ss,{className:"theme-".concat(s),children:[(0,g.jsx)(x.A,{}),(0,g.jsx)(m.A,{children:(0,g.jsxs)(t.Ss,{className:"orders-page",children:[(0,g.jsxs)(t.Ss,{className:"page-header dashed-card mt-20",style:{marginTop:"".concat(a.headerPaddingTop,"px")},children:[(0,g.jsx)(t.Ss,{className:"star-badge"}),(0,g.jsx)(t.EY,{className:"page-title",children:"\u6211\u7684\u8ba2\u5355"})]}),(0,g.jsx)(t.Ss,{className:"status-tabs",children:(0,g.jsx)(t.BM,{className:"tabs-scroll",scrollX:!0,children:b.map(function(e){return(0,g.jsxs)(t.Ss,{className:"tab-item ".concat(f===e.code?"active":""),onTap:function(){return N(e.code)},children:[(0,g.jsx)(t.EY,{className:"tab-label",children:e.label}),f===e.code&&(0,g.jsx)(t.Ss,{className:"tab-underline"})]},e.code)})})}),(0,g.jsxs)(t.BM,{className:"orders-list",scrollY:!0,children:[w.map(function(e){var s,a=j[e.statusCode]||j.pending,n=null!==(s=e.productIcon)&&void 0!==s&&s.startsWith("/icon/")||/^https?:/i.test(e.productIcon||"")?e.productIcon:"/icon/\u56db\u89d2\u661f.png",r=(0,d.uq)(n);return(0,g.jsxs)(t.Ss,{className:"order-card dashed-card",onTap:function(){return y(e)},children:[(0,g.jsx)(t.Ss,{className:"star-badge"}),(0,g.jsxs)(t.Ss,{className:"order-header",children:[(0,g.jsx)(t.EY,{className:"order-date",children:e.date}),(0,g.jsx)(t.EY,{className:"badge ".concat(a.badge),children:a.label})]}),(0,g.jsxs)(t.Ss,{className:"order-body",children:[(0,g.jsx)(t.Ss,{className:"order-icon-wrapper",children:(0,g.jsx)(t._V,{className:"order-icon-img",src:r,mode:"aspectFit"})}),(0,g.jsxs)(t.Ss,{className:"order-info",children:[(0,g.jsx)(t.EY,{className:"order-product",children:e.productName}),(0,g.jsx)(t.EY,{className:"order-sku",children:e.sku}),(0,g.jsxs)(t.EY,{className:"order-meta",children:["\u6570\u91cf: ",e.count," \u4ef6 | ",e.id]})]})]}),(0,g.jsxs)(t.Ss,{className:"order-footer",children:[(0,g.jsxs)(t.Ss,{className:"order-price-bar",children:[(0,g.jsx)(t.EY,{className:"price-label",children:"\u5b9e\u4ed8\u6b3e"}),(0,g.jsx)(t.EY,{className:"price-value",children:e.price})]}),(0,g.jsxs)(t.Ss,{className:"order-actions",children:["pending"===e.statusCode&&(0,g.jsx)(t.Ss,{className:"btn-gradient order-btn",children:(0,g.jsx)(t.EY,{children:"\u7acb\u5373\u4ed8\u6b3e"})}),"paid"===e.statusCode&&(0,g.jsx)(t.Ss,{className:"btn-outline order-btn",children:(0,g.jsx)(t.EY,{children:"\u50ac\u53d1\u8d27"})}),"shipping"===e.statusCode&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(t.Ss,{className:"btn-outline order-btn",onTap:function(e){e.stopPropagation(),o().showToast({title:"\u67e5\u770b\u7269\u6d41",icon:"none"})},children:(0,g.jsx)(t.EY,{children:"\u67e5\u770b\u7269\u6d41"})}),(0,g.jsx)(t.Ss,{className:"btn-gradient order-btn",onTap:function(e){e.stopPropagation(),o().showToast({title:"\u786e\u8ba4\u6536\u8d27",icon:"none"})},children:(0,g.jsx)(t.EY,{children:"\u786e\u8ba4\u6536\u8d27"})})]}),"done"===e.statusCode&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(t.Ss,{className:"btn-outline order-btn",onTap:function(e){e.stopPropagation(),o().showToast({title:"\u7533\u8bf7\u552e\u540e",icon:"none"})},children:(0,g.jsx)(t.EY,{children:"\u7533\u8bf7\u552e\u540e"})}),(0,g.jsx)(t.Ss,{className:"btn-gradient order-btn",onTap:function(e){e.stopPropagation(),o().showToast({title:"\u518d\u6765\u4e00\u5355",icon:"none"})},children:(0,g.jsx)(t.EY,{children:"\u518d\u6765\u4e00\u5355"})})]}),(0,g.jsx)(t.Ss,{className:"btn-outline order-btn",onTap:function(s){s.stopPropagation(),y(e)},children:(0,g.jsx)(t.EY,{children:"\u8be6\u60c5"})})]})]})]},e.id)}),0===w.length&&(0,g.jsxs)(t.Ss,{className:"empty-state",children:[(0,g.jsx)(t._V,{className:"empty-icon-img",src:"/icon/\u5305\u88f9.png",mode:"aspectFit"}),(0,g.jsx)(t.EY,{className:"empty-text",children:"\u6682\u65e0\u8ba2\u5355"}),(0,g.jsx)(t.EY,{className:"empty-sub",children:"\u53bb\u9996\u9875\u5f00\u59cb\u5b9a\u5236\u5427"}),(0,g.jsx)(t.Ss,{className:"btn-gradient",onTap:function(){return o().switchTab({url:"/pages/index/index"})},children:(0,g.jsx)(t.EY,{children:"\u53bb\u5b9a\u5236"})})]})]}),(0,g.jsx)(t.Ss,{style:{height:"40px"}})]})})]})}var N={navigationStyle:"custom",enablePageMeta:!0,navigationBarTitleText:"\u8ba2\u5355\u5217\u8868"};Page((0,n.createPageConfig)(f,"pages/orders/index",{root:{cn:[]}},N||{}))}},function(e){var s=function(s){return e(e.s=s)};e.O(0,[907,96,76],function(){return s(2307)});e.O()}]); \ No newline at end of file diff --git a/src/pages/designList/index.tsx b/src/pages/designList/index.tsx index 8e007eb..d4a4949 100644 --- a/src/pages/designList/index.tsx +++ b/src/pages/designList/index.tsx @@ -4,6 +4,7 @@ import { useState, useEffect, useCallback } from 'react' import './index.scss' import { getDesignList, removeDesigns, type DesignItem } from '../../utils/store' import { PRODUCT_ICON_MAP } from '../../utils/productConfig' +import { assetUrl } from '../../utils/asset' import { useThemeContext } from '../../context/ThemeContext' import { useSafeArea } from '../../hooks/useSafeArea' import { useStatusBar } from '../../hooks/useStatusBar' @@ -164,9 +165,10 @@ export default function DesignListPage() { {filtered.map(item => { const style = STATUS_STYLE[item.status] - const iconSrc = item.productIcon?.startsWith('/icon/') + const rawIcon = item.productIcon?.startsWith('/icon/') || /^https?:/i.test(item.productIcon || '') ? item.productIcon : PRODUCT_ICON_MAP[item.productId] || '/icon/四角星.png' + const iconSrc = assetUrl(rawIcon) const isSelected = selected.has(item.id) return ( = { - 'notebook-small': '/img/book_small/The1.jpg', - 'notebook-large': '/img/book_big/The1.jpg', - 'coaster': '/img/cup/The1.jpg', - 'penbox': '/img/penbox/The1.jpg', - 'booklamp': '/img/booklight/The1.jpg' + 'notebook-small': assetUrl('/img/book_small/The1.jpg'), + 'notebook-large': assetUrl('/img/book_big/The1.jpg'), + 'coaster': assetUrl('/img/cup/The1.jpg'), + 'penbox': assetUrl('/img/penbox/The1.jpg'), + 'booklamp': assetUrl('/img/booklight/The1.jpg') } export default function Index() { diff --git a/src/pages/orderDetail/index.tsx b/src/pages/orderDetail/index.tsx index 7722435..426e450 100644 --- a/src/pages/orderDetail/index.tsx +++ b/src/pages/orderDetail/index.tsx @@ -8,6 +8,7 @@ import { useStatusBar } from '../../hooks/useStatusBar' import ThemedPageMeta from '../../components/ThemedPageMeta' import { getOrderList, getDefaultAddress, getAddressList, type AddressItem, type OrderItem } from '../../utils/store' import { PRODUCT_ICON_MAP } from '../../utils/productConfig' +import { assetUrl } from '../../utils/asset' export default function OrderDetailPage() { const { theme, resolvedTheme } = useThemeContext() @@ -138,9 +139,9 @@ export default function OrderDetailPage() { - diff --git a/src/pages/orders/index.tsx b/src/pages/orders/index.tsx index c6abcaf..ddad7dc 100644 --- a/src/pages/orders/index.tsx +++ b/src/pages/orders/index.tsx @@ -4,6 +4,7 @@ import { useState, useEffect } from 'react' import './index.scss' import { getOrderList, type OrderItem } from '../../utils/store' import { PRODUCT_ICON_MAP } from '../../utils/productConfig' +import { assetUrl } from '../../utils/asset' import { useThemeContext } from '../../context/ThemeContext' import { useSafeArea } from '../../hooks/useSafeArea' import { useStatusBar } from '../../hooks/useStatusBar' @@ -105,9 +106,10 @@ export default function OrdersPage() { {filteredOrders.map((order) => { const status = STATUS_MAP[order.statusCode] || STATUS_MAP.pending - const iconSrc = order.productIcon?.startsWith('/icon/') + const rawIcon = order.productIcon?.startsWith('/icon/') || /^https?:/i.test(order.productIcon || '') ? order.productIcon : '/icon/四角星.png' + const iconSrc = assetUrl(rawIcon) return ( goDetail(order)}> diff --git a/src/utils/asset.ts b/src/utils/asset.ts new file mode 100644 index 0000000..17fc880 --- /dev/null +++ b/src/utils/asset.ts @@ -0,0 +1,29 @@ +/** + * 静态资源基址。 + * + * 留空表示继续使用小程序包内本地资源(/icon、/img); + * 配置阿里云 OSS / CDN 后,所有经 assetUrl 处理的资源会自动拼接远程地址。 + */ +export const ASSET_BASE_URL = '' + +/** 把本地资源路径转成远程 URL;已经是 http(s) 或 wxfile/data 的保持不变 */ +export function assetUrl(path?: string | null): string { + if (!path) return '' + if (/^(https?:|wxfile:|data:)/i.test(path)) return path + if (!ASSET_BASE_URL) return path + const base = ASSET_BASE_URL.replace(/\/+$/, '') + const normalized = path.startsWith('/') ? path : `/${path}` + return `${base}${normalized}` +} + +/** 从旧存储中解析商品图标:兼容本地 /icon、远程 URL 和老版 emoji 缺省值 */ +export function resolveStoredIcon( + value?: string, + fallback = '/icon/四角星.png', +): string { + if (!value) return assetUrl(fallback) + if (value.startsWith('/icon/') || /^https?:/i.test(value)) { + return assetUrl(value) + } + return assetUrl(fallback) +} diff --git a/src/utils/productConfig.ts b/src/utils/productConfig.ts index e36a7db..fb9dd0f 100644 --- a/src/utils/productConfig.ts +++ b/src/utils/productConfig.ts @@ -6,8 +6,9 @@ */ import { ProductCategory } from '../types' +import { assetUrl } from './asset' -export const PRODUCTS: ProductCategory[] = [ +const PRODUCTS_LOCAL: ProductCategory[] = [ { id: 'notebook-small', name: '微雕笔记本(小)', @@ -169,6 +170,13 @@ export const PRODUCTS: ProductCategory[] = [ } ] +/** 导出产品列表:资源地址统一经过 assetUrl,配置 ASSET_BASE_URL 后自动切远程 */ +export const PRODUCTS = PRODUCTS_LOCAL.map(p => ({ + ...p, + images: (p.images || []).map(image => assetUrl(image)), + iconImg: assetUrl(p.iconImg), +})) + /** CATEGORIES 为 PRODUCTS 的别名,供页面引用 */ export const CATEGORIES = PRODUCTS @@ -184,11 +192,11 @@ export const getProductById = (id: string): ProductCategory | undefined => { * 用于兼容旧数据(旧数据 productIcon 存的是 emoji) */ export const PRODUCT_ICON_MAP: Record = { - 'notebook-small': '/icon/书本.png', - 'notebook-large': '/icon/书本_大.png', - 'coaster': '/icon/杯子.png', - 'penbox': '/icon/笔盒.png', - 'booklamp': '/icon/书灯.png' + 'notebook-small': assetUrl('/icon/书本.png'), + 'notebook-large': assetUrl('/icon/书本_大.png'), + 'coaster': assetUrl('/icon/杯子.png'), + 'penbox': assetUrl('/icon/笔盒.png'), + 'booklamp': assetUrl('/icon/书灯.png') } /** @@ -198,7 +206,7 @@ export const PRODUCT_ICON_MAP: Record = { * - 兜底:返回四角星 */ export function getProductIconImg(product: any): string { - if (product?.iconImg) return product.iconImg - if (product?.id) return PRODUCT_ICON_MAP[product.id] || '/icon/四角星.png' - return '/icon/四角星.png' + if (product?.iconImg) return assetUrl(product.iconImg) + if (product?.id) return assetUrl(PRODUCT_ICON_MAP[product.id] || '/icon/四角星.png') + return assetUrl('/icon/四角星.png') } diff --git a/src/utils/store.ts b/src/utils/store.ts index 4519409..92677ee 100644 --- a/src/utils/store.ts +++ b/src/utils/store.ts @@ -1,6 +1,7 @@ import Taro from '@tarojs/taro' import type { DesignItem, OrderItem, AddressItem, StickerItem } from '../types' import { PRODUCT_ICON_MAP } from './productConfig' +import { assetUrl } from './asset' import { invalidateAuthCache } from './authState' // 重新导出类型,供各页面从 store 直接引用(修正原「声明但不导出」的编译错误) @@ -175,7 +176,7 @@ export function setDesignList(list: DesignItem[]) { export function addDesign(product: any, count: number): DesignItem { const list = getDesignList() - const iconImg = product?.iconImg || PRODUCT_ICON_MAP[product?.id] || '/icon/四角星.png' + const iconImg = assetUrl(product?.iconImg || PRODUCT_ICON_MAP[product?.id] || '/icon/四角星.png') const item: DesignItem = { id: 'DSG' + Date.now(), productId: product.id, @@ -226,10 +227,12 @@ export function designToOrder(designId: string): OrderItem | null { const design = dList.find(d => d.id === designId) if (!design) return null - const iconImg = design.productIcon?.startsWith('/icon/') + const rawIcon = design.productIcon?.startsWith('/icon/') || /^https?:/i.test(design.productIcon || '') ? design.productIcon : PRODUCT_ICON_MAP[design.productId] || '/icon/四角星.png' + const iconImg = assetUrl(rawIcon) + const order: OrderItem = { id: 'ORD' + Date.now().toString().slice(-9), productName: design.productName,