1 line
2.7 KiB
JavaScript
1 line
2.7 KiB
JavaScript
"use strict";(wx["webpackJsonp"]=wx["webpackJsonp"]||[]).push([[205],{6296:function(e,s,a){var c=a(7842),n=a(1212),r=a(467),t=a(5544),i=a(118),o=a(758),l=a.n(o),h=a(6540),d=a(9703),p=a(9201),u=a(5414),m=a(9674),x=a(3053),g=a(2371),f=a(4848);function j(){var e=(0,d.wR)(),s=e.resolvedTheme,a=(0,p.c)();(0,u.l)(s);var c=(0,h.useState)([]),o=(0,t.A)(c,2),j=o[0],N=o[1],S=(0,h.useState)(!0),v=(0,t.A)(S,2),b=v[0],E=v[1],w=(0,h.useState)(""),k=(0,t.A)(w,2),A=k[0],Y=k[1],T=(0,h.useCallback)((0,r.A)((0,n.A)().m(function e(){var s,a;return(0,n.A)().w(function(e){while(1)switch(e.p=e.n){case 0:return E(!0),Y(""),e.p=1,e.n=2,(0,g.j0)({page:1,pageSize:100});case 2:s=e.v,N(s.list),e.n=4;break;case 3:e.p=3,a=e.v,Y(a instanceof Error?a.message:"\u5546\u54c1\u52a0\u8f7d\u5931\u8d25\uff0c\u8bf7\u91cd\u8bd5");case 4:return e.p=4,E(!1),e.f(4);case 5:return e.a(2)}},e,null,[[1,3,4,5]])})),[]);(0,h.useEffect)(function(){T()},[T]);var y=function(e){l().navigateTo({url:"/pages/shop/detail/index?id=".concat(e)})};return(0,f.jsxs)(i.Ss,{className:"shop-page theme-".concat(s),children:[(0,f.jsx)(m.A,{}),(0,f.jsx)(x.A,{title:"\u667a\u7ed8\u7cbe\u9009",targetSelector:".shop-header"}),(0,f.jsxs)(i.Ss,{className:"shop-list",children:[(0,f.jsxs)(i.Ss,{className:"shop-header",style:{paddingTop:"".concat(a.statusBarHeight+12,"px")},children:[(0,f.jsx)(i.EY,{className:"shop-header-title",children:"\u667a\u7ed8\u7cbe\u9009"}),(0,f.jsx)(i.EY,{className:"shop-header-sub",children:"\u6fc0\u5149\u5fae\u96d5\u5b9a\u5236\u597d\u7269"})]}),(0,f.jsx)(i.Ss,{className:"shop-grid",children:j.map(function(e){var s=e.images[0]||e.iconImg||"";return(0,f.jsxs)(i.Ss,{className:"shop-card",onTap:function(){return y(e.id)},children:[(0,f.jsx)(i.Ss,{className:"shop-card-img-wrap",children:(0,f.jsx)(i._V,{className:"shop-card-img",src:s,mode:"aspectFill",lazyLoad:!0})}),(0,f.jsxs)(i.Ss,{className:"shop-card-body",children:[(0,f.jsx)(i.EY,{className:"shop-card-name",children:e.name}),(0,f.jsx)(i.EY,{className:"shop-card-desc",children:e.subtitle||e.description||""}),(0,f.jsxs)(i.EY,{className:"shop-card-price",children:["\xa5",e.price]})]})]},e.id)})}),b&&(0,f.jsx)(i.EY,{className:"shop-feedback",children:"\u6b63\u5728\u52a0\u8f7d\u5546\u54c1\u2026"}),!b&&A&&(0,f.jsx)(i.Ss,{className:"shop-feedback shop-feedback-action",onTap:T,children:(0,f.jsxs)(i.EY,{children:["\u52a0\u8f7d\u5931\u8d25\uff1a",A,"\u3002\u70b9\u51fb\u91cd\u8bd5"]})}),!b&&!A&&0===j.length&&(0,f.jsx)(i.EY,{className:"shop-feedback",children:"\u6682\u65e0\u5728\u552e\u5546\u54c1"})]})]})}var N={navigationStyle:"custom",enablePageMeta:!0};Page((0,c.createPageConfig)(j,"pages/shop/index",{root:{cn:[]}},N||{}))}},function(e){var s=function(s){return e(e.s=s)};e.O(0,[907,96,76],function(){return s(6296)});e.O()}]); |