"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()}]);