2022-09-15 19:59:19 +08:00

1 line
42 KiB
JavaScript

"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[592],{2185:function(e,n,t){t.d(n,{EX:function(){return a},Rf:function(){return o},Xn:function(){return u},hE:function(){return c},n4:function(){return i}});var r=t(1948),o=function GetAddressListApi(){return(0,r.Q)({url:"/v1/mp/district/list",method:"get"})},c=function mppurchaseraddresslist(){return(0,r.Q)({url:"/v1/mp/purchaser/address/list",method:"get"})},a=function mppurchaseraddress(){return(0,r.Q)({url:"/v1/mp/purchaser/address",method:"post"})},i=function mppurchaseraddressget(){return(0,r.Q)({url:"/v1/mp/purchaser/address",method:"get"})},u=function mppurchaseraddressput(){return(0,r.Q)({url:"/v1/mp/purchaser/address",method:"put"})}},9771:function(e,n,t){t.d(n,{J_:function(){return u},m$:function(){return i},lG:function(){return s},rg:function(){return d},Ig:function(){return o},lg:function(){return m},oF:function(){return a},HE:function(){return l},GI:function(){return _},tH:function(){return c}});var r=t(1948),o=function LoginApi(){return(0,r.Q)({url:"/v1/mp/login",method:"post"})},c=function productabsorbcontrast(){return(0,r.Q)({url:"/v1/mall/product/color/absorb/contrast",method:"get"})},a=function SelectProductListApi(){return(0,r.Q)({url:"/v1/mp/enum/product/list",method:"get"})},i=function ColorListApi(){return(0,r.Q)({url:"/v1/mp/product/color/absorb/list",method:"get"})},u=function ColorDetailedApi(){return(0,r.Q)({url:"/v1/mp/product/texture",method:"get"})},s=function ColorSamplingSaveApi(){return(0,r.Q)({url:"/v1/mp/product/color/absorb",method:"put"})},l=function TextureSaveApi(){return(0,r.Q)({url:"/v1/mp/product/texture",method:"put"})},d=function FindColorListApi(){return(0,r.Q)({url:"/v1/mp/product/color/absorb/match",method:"get"})},_=function kindListApi(){return(0,r.Q)({url:"/v1/mp/product/kind/list",method:"get"})},m=function ProductListApi(){return(0,r.Q)({url:"/v1/mp/product/list",method:"get"})}},1251:function(e,n,t){t.d(n,{BD:function(){return u},Fm:function(){return l},Gg:function(){return m},Rv:function(){return d},Vy:function(){return a},a3:function(){return h},dl:function(){return i},eS:function(){return _},fs:function(){return p},fu:function(){return f},ot:function(){return v},rj:function(){return c},sg:function(){return s}});var r=t(1948),o=t(7903),c=function mpenumsaleorderstatus(){return(0,r.Q)({url:"/v1/mp/enum/sale/order/status",method:"get"})},a=function OrderListApi(){return(0,r.Q)({url:"/v2/mp/saleOrder/list",method:"get"})},i=function ClientListApi(){return(0,r.Q)({url:"/v1/mp/purchaser/list",method:"get"})},u=function mpproductcolorlist(){return(0,r.Q)({url:"/v1/mp/product/color/list",method:"get"})},s=function mpsaleOrderpreView(){return(0,r.Q)({url:"/v1/mp/saleOrder/preView",method:"put"})},l=function mpenumsaleUserlist(){return(0,r.Q)({url:"/v1/mp/enum/saleUser/list",method:"get"})},d=function mpsaleOrdercancel(){return(0,r.Q)({url:"/v1/mp/saleOrder/cancel",method:"put"})},_=function mpshoppingCartproductColorlist(){return(0,r.Q)({url:"/v1/mp/shoppingCart/productColor/list",method:"post"})},m=function orderPaymentorderPaymentMethodInfo(){return(0,r.Q)({url:"/v1/mp/orderPayment/orderPaymentMethodInfo",method:"get"})},f=function orderPaymentpreCollectOrderorderPaymentMethodInfo(){return(0,r.Q)({url:"/v1/mp/orderPayment/preCollectOrder/orderPaymentMethodInfo",method:"get"})},h=function orderPaymentorderPaymentSubmission(){return(0,r.Q)({url:"/v1/mp/orderPayment/orderPaymentSubmission",method:"put"})},v=function orderPaymentpreCollectOrderorderPaymentSubmission(){return(0,r.Q)({url:"/v1/mp/orderPayment/preCollectOrder/orderPaymentSubmission",method:"put"})},p=function GetPayCode(){return(0,r.Q)({url:"/xima-caphtml/caphtml",base_url:o.iv,method:"post"})}},1115:function(e,n,t){t.d(n,{Z9:function(){return u},jD:function(){return i}});var r=t(2535),o=t.n(r),c=t(8748),a=t.n(c),i=function goLink(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"navigateTo";if(e){var r=a().stringify(n);e=r?e+"?"+r:e,o()[t]({url:e})}},u={success:function success(e){o().showToast({title:e,icon:"success"})},error:function error(e){o().showToast({title:e,icon:"error"})},loading:function loading(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];o().showToast({title:e,icon:"loading",mask:n})},none:function none(e){o().showToast({title:e,icon:"none"})},showLoading:function showLoading(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];o().showLoading({title:e,mask:n})},hideLoading:function hideLoading(){o().hideLoading()}}},7903:function(e,n,t){t.d(n,{KC:function(){return o},Kj:function(){return a},_n:function(){return r},iv:function(){return c}});var r="https://www.zzfzyc.com/lymarket",o="production".includes("production")?"https://cdn.zzfzyc.com":"https://test.cdn.zzfzyc.com",c="production".includes("production")?"https://www.zzfzyc.com":"https://test.zzfzyc.com",a=("".concat("https://v0.api.upyun.com/"),"wx64fe67f111d52457")},4812:function(e,n,t){t.d(n,{$y:function(){return s},W7:function(){return c},o0:function(){return l},yb:function(){return u},z:function(){return _}});var r=t(7903),o=function formatRemoveHashTag(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.endsWith("#")?e.replace("#",""):e},c=function formatHashTag(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"both";return"both"==t?"".concat(o(e),"# ").concat(n):"name"==t?"".concat(n):void 0},a=100,i=1e3,u=function formatPriceDiv(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a,t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=d(Number(e/n))||0;return t?m({number:r}):r},s=function formatWeightDiv(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:i;return d(Number(e/n))||0},l=function formatDateTime(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"YYYY-MM-DD HH:mm:ss";if(e){var t=new Date(e),r=t.getFullYear(),o=t.getMonth()+1,c=t.getDate(),a=t.getHours(),i=t.getMinutes(),u=t.getSeconds();return n=n.replace("YYYY",r).replace("MM",o.toString().padStart(2,"0")).replace("DD",c.toString().padStart(2,"0")).replace("HH",a.toString().padStart(2,"0")).replace("mm",i.toString().padStart(2,"0")).replace("ss",u.toString().padStart(2,"0"))}return e},d=function strip(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12;return+parseFloat(e.toPrecision(n))},_=function formatImgUrl(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"!w200";return e?e.includes("http")?e+n:r.KC+e+n:r.KC+"/mall/no_img.png"},m=function numberWithCommas(e){var n=e.number,t=void 0===n?0:n,r=e.digit,o=void 0===r?2:r;return isNaN(Number(t))?0:parseFloat(t).toLocaleString("zh",{minimumFractionDigits:o})}},7227:function(e,n,t){t.d(n,{rA:function(){return d},Ds:function(){return u},mB:function(){return l},WL:function(){return _},P2:function(){return s}});var r=t(4812),o=t(2535),c=t.n(o),a=t(7903),i=function bindParent(e){c().request({url:a._n+"/v1/mall/shortCode/bind",method:"POST",data:{share_user_id:e},success:function success(e){e.data.code}})},u=function debounce(e,n){var t=null;return function(){for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];t&&clearTimeout(t),t=setTimeout((function(){e.apply(void 0,o)}),n)}},s=function throttle(e,n){var t=0;return function(){var r=(new Date).getTime();r-t>n&&(e.apply(void 0,arguments),t=r)}},l=function getFilterData(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],t={};for(var r in e)void 0===e[r]||null===e[r]||""===e[r]||n.includes(r)||"number"==typeof e[r]&&isNaN(e[r])||(t[r]=e[r]);return t},d=function dataLoadingStatus(e){var n=e.list,t=void 0===n?[]:n,r=e.total,o=void 0===r?0:r,c=e.status,a=void 0!==c&&c;return 0==t.length&&a?0:0!=t.length||a?t.length<o?2:3:1},_=function shareShop(){var e,n=c().getCurrentInstance().page;n&&null!==(e=n.options)&&void 0!==e&&e.share&&function analysisShortCodeApi(e){c().request({url:a._n+"/v1/mall/shortCode",method:"GET",data:{md5_key:e},success:function success(e){0==e.data.code&&i(e.data.data.share_user_id)}})}(n.options.share),n&&n.onShareAppMessage&&(n.onShareAppMessage=function(e){var t="",o="",a="",i=c().getStorageSync("sort_code")?JSON.parse(c().getStorageSync("sort_code")):"",u=n;return"pages/details/index"===u.route?(t="/pages/details/index?share=".concat(i.shareShortDetail.code),o=i.shareShortDetail.title,a=i.shareShortDetail.img):(t="pages/user/index"===u.route?"/pages/user/index?share=".concat(i.shareShortPage.code):"/pages/index/index?share=".concat(i.shareShortPage.code),o=i.shareShortPage.title,a="pages/user/index"===u.route?i.shareShortPage.img:(0,r.z)("/mall/share_img_02.png","!w400")),{title:o,path:t,imageUrl:a}})}},6631:function(e,n,t){t.d(n,{Z:function(){return l}});var r=t(1515),o=t(9792),c="index-module__flexBox___metF7",a="index-module__cancle___Fnzm8",i="index-module__nextBuy___xDX5w",u="index-module__toBuy___mXZm0",s=t(5513),l=(0,o.memo)((function(e){var n=e.obj,t=void 0===n?{sale_mode:0,collect_status:"",status:"",payment_method:0}:n,l=e.cancle,d=e.nextBuy,_=e.toPay,m=(0,o.useMemo)((function(){return 0===t.sale_mode&&0===t.status||0===t.sale_mode&&1===t.status||0===t.sale_mode&&2===t.status||0===t.sale_mode&&11===t.status&&0==t.collect_status||0===t.sale_mode&&7===t.status&&0==t.collect_status||0===t.sale_mode&&3===t.status&&(3==t.payment_method||5==t.payment_method)||1===t.sale_mode&&10===t.status||2===t.sale_mode&&10===t.status}),[t]),f=(0,o.useMemo)((function(){return 0===t.sale_mode||1===t.sale_mode&&10!==t.status||2===t.sale_mode&&10!==t.status}),[t]),h=(0,o.useMemo)((function(){return 0===t.sale_mode&&7===t.status&&1==t.collect_status||0===t.sale_mode&&3===t.status&&1==t.collect_status||0===t.sale_mode&&3===t.status&&(3==t.payment_method||5==t.payment_method)||0===t.sale_mode&&8===t.status&&(3==t.payment_method||5==t.payment_method||1==t.collect_status)||0===t.sale_mode&&9===t.status&&(3==t.payment_method||5==t.payment_method||1==t.collect_status)||2===t.sale_mode&&7===t.status}),[t]);return(0,s.jsxs)(r.G7,{className:c,children:[m&&(0,s.jsx)(r.G7,{className:a,onClick:function onClick(e){return null==l?void 0:l(e)},children:"取消订单"}),f&&(0,s.jsx)(r.G7,{className:i,onClick:function onClick(e){return null==d?void 0:d(e)},children:"再次购买"}),h&&(0,s.jsx)(r.G7,{className:u,onClick:function onClick(e){return null==_?void 0:_(e)},children:"去付款"})]})}))},7816:function(e,n,t){t.d(n,{Z:function(){return g}});var r=t(1413),o=t(885),c=t(4812),a=t(1515),i=t(9792),u="index-module__labAndImg_main___OwIRf",s="index-module__boxColor___yBg_6",l="index-module__labAndImg_image___rJfJX",d="index-module__main___GDLhm",_="index-module__con___nWDsa",m="index-module__rgb___kiKmO",f="index-module__name___dQ8lF",h=t(2535),v=t.n(h),p=t(5513),LabAndImgShow=function(e){var n=e.value,t=e.show,r=void 0!==t&&t,u=e.onClose,s=e.showNumber,l=void 0===s?1:s;(0,i.useEffect)((function(){r&&y&&b((function(){return!0})),r&&null!=n&&n.texture_url&&w(),r||b((function(){return!1}))}),[r]);var h=(0,i.useState)(!1),g=(0,o.Z)(h,2),x=g[0],b=g[1],y=(0,i.useMemo)((function(){var e,t,r;return null!=n&&n.lab&&(n.lab.l||n.lab.a||n.lab.b)?{backgroundColor:"rgb(".concat(null===(e=n.rgb)||void 0===e?void 0:e.r," ").concat(null===(t=n.rgb)||void 0===t?void 0:t.g," ").concat(null===(r=n.rgb)||void 0===r?void 0:r.b,")")}:null}),[n]),w=function onShowImage(){var e;null==u||u();var t,r=[];null!=n&&n.texture_url&&(r=null==n||null===(t=n.texture_url)||void 0===t?void 0:t.split(",").map((function(e){return(0,c.z)(e)})));var o=0==l?r:null===(e=r)||void 0===e?void 0:e.splice(0,l);v().previewImage({current:o[0],urls:o})};return(0,p.jsx)(p.Fragment,{children:x&&(0,p.jsx)(a.G7,{className:d,"catch-move":"true",onClick:function onClick(){return null==u?void 0:u()},children:(0,p.jsxs)(a.G7,{className:_,children:[(0,p.jsx)(a.G7,{className:m,style:y}),(0,p.jsx)(a.G7,{className:f,children:null==n?void 0:n.title})]})})})},g=(0,i.memo)((function(e){var n=e.value,t=e.onClick,d=e.showStatus,_=void 0!==d&&d,m=(0,i.useState)([]),f=(0,o.Z)(m,2),h=f[0],v=f[1],g=(0,i.useMemo)((function(){var e,t,r;return null!=n&&n.lab&&(n.lab.l||n.lab.a||n.lab.b)?{backgroundColor:"rgb(".concat(null===(e=n.rgb)||void 0===e?void 0:e.r," ").concat(null===(t=n.rgb)||void 0===t?void 0:t.g," ").concat(null===(r=n.rgb)||void 0===r?void 0:r.b,")")}:null}),[n]);(0,i.useEffect)((function(){if(null!=n&&n.texture_url){var e=n.texture_url.split(",").map((function(e){return(0,c.z)(e)}));v((function(){return e}))}}),[n]);var x=(0,i.useState)(!1),b=(0,o.Z)(x,2),y=b[0],w=b[1],S=(0,i.useCallback)((function(){w(!1)}),[]),C=function onShowLabAndImg(){if(null==t||t(n),!_)return!1;w(!0)};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(a.G7,{className:u,onClick:function onClick(){return C()},children:[(null==h?void 0:h.length)>0&&(0,p.jsx)(a.Ee,{mode:"aspectFill",src:h[0],className:l}),!(null!=h&&h.length)&&g&&(0,p.jsx)(a.G7,{className:s,style:(0,r.Z)({},g)}),!(null!=h&&h.length)&&!g&&(0,p.jsx)(a.Ee,{mode:"aspectFill",src:(0,c.z)(""),className:l})]}),(0,p.jsx)(LabAndImgShow,{value:n,show:y,onClose:S})]})}))},3051:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1515),o=t(9792),c="index-module__icon_a_cuowuwrong_self___Icity",a="index-module__icon_a_btn___KAdGf",i=t(5513),u=(0,o.memo)((function(e){var n=e.onClose,t=e.styleObj,o=void 0===t?{}:t;return(0,i.jsx)(r.G7,{style:o,className:c,onClick:n,children:(0,i.jsx)(r.xv,{className:"iconfont icon-guanbi ".concat(a)})})}))},5467:function(e,n,t){t.d(n,{Z:function(){return u}});var r=t(1515),o=t(9792),c="index-module__load_box___thIT2",a="index-module__load_box_item___K1frK",i=t(5513),u=(0,o.memo)((function(){return(0,i.jsx)(i.Fragment,{children:(0,i.jsxs)(r.G7,{className:c,children:[(0,i.jsx)(r.G7,{className:a}),(0,i.jsx)(r.G7,{className:a}),(0,i.jsx)(r.G7,{className:a}),(0,i.jsx)(r.G7,{className:a}),(0,i.jsx)(r.G7,{className:a})]})})}))},8560:function(e,n,t){t.d(n,{Z:function(){return l}});var r=t(1515),o=t(6666),c="index-module__iconCard___XnEyk",a="index-module__iconCard-name___yopDI",i=t(6408),u=t.n(i),s=t(5513),l=function IconCard(e){var n=e.iconName,t=e.title,i=e.onClick,l=e.customClass,d=void 0===l?"":l,_=e.iconSize,m=void 0===_?72:_;return(0,s.jsxs)(r.G7,{className:u()(c,d),onClick:function handleClick(e){i&&i(e)},children:[(0,s.jsx)(o.Z,{name:n,size:m}),(0,s.jsx)(r.G7,{className:a,children:t})]})}},6666:function(e,n,t){t(9792);var r=t(2535),o=t.n(r),c=t(5513),a=function IconFont(e){var n=e.name,t=e.size,r=e.color,a=e.style;return(0,c.jsx)("iconfont",{name:n,size:parseFloat(o().pxTransform(t)),color:r,style:a})};a.defaultProps={size:18},n.Z=a},4909:function(e,n,t){t.d(n,{Z:function(){return _}});var r=t(1515),o=t(9792),c={common_safe_area_y:"index-module__common_safe_area_y___TfGaJ","full-100":"index-module__full-100___Zf65j","color-blue":"index-module__color-blue___u2r3b","color-yellow":"index-module__color-yellow____2mxw","color-green":"index-module__color-green___dTahV","color-grey":"index-module__color-grey___u8luj","color-white":"index-module__color-white___WLB19",scroll_main:"index-module__scroll_main___rWSFU",infinite_scroll:"index-module__infinite_scroll___GY4by",loading_more:"index-module__loading_more___Iljay",noMore:"index-module__noMore___kPVsd"},a=t(5467),i=t(7046),u="index-module__loadingCard_main___DtPqQ",s="index-module__loading_text___QyQXx",l=t(5513),d=(0,o.memo)((function(e){e.styleLoading;var n=e.title,t=void 0===n?"加载中...":n,o=e.loadingIcon,c=void 0===o||o;return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(r.G7,{className:u,children:[c&&(0,l.jsx)(i.Z,{}),(0,l.jsx)(r.G7,{className:s,children:t})]})})})),_=(0,o.memo)((function(e){var n=e.styleObj,t=e.selfonScrollToLower,i=e.selfOnScrollToUpper,u=e.selfOnScroll,s=e.selfOnRefresherPulling,_=e.selfOnRefresherRefresh,m=e.selfOnRefresherRestore,f=e.selfOnRefresherAbort,h=(e.hasMore,e.children),v=e.lowerThresholdNum,p=void 0===v?5:v,g=e.paddingBottom,x=void 0===g?0:g,b=e.refresherTriggered,y=void 0!==b&&b,w=e.refresherEnabled,S=void 0!==w&&w,C=e.moreStatus,k=void 0===C||C,Z=e.statusMore,I=void 0===Z?0:Z,T=(0,o.useMemo)((function(){if(0==I)return.1}),[I]);return(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(r.pf,{style:n,className:c.scroll_main,scrollY:!0,onScrollToLower:function onScrollToLower(){return function scrollToLower(){null==t||t()}()},onScrollToUpper:function onScrollToUpper(){return function scrollToUpper(){null==i||i()}()},onScroll:function onScroll(e){return function scroll(e){null==u||u(e)}(e)},lowerThreshold:p,refresherEnabled:S,refresherTriggered:y,onRefresherPulling:function onRefresherPulling(){return function refresherPulling(){null==s||s()}()},onRefresherRefresh:function onRefresherRefresh(){return function refresherRefresh(){null==_||_()}()},onRefresherRestore:function onRefresherRestore(){return function refresherRestore(){null==m||m()}()},onRefresherAbort:function onRefresherAbort(){return function refresherAbort(){null==f||f()}()},refresherBackground:"#F8F8F8",scrollTop:T,children:[!k&&(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(r.G7,{style:{paddingBottom:x+"rpx"},className:c.scrollViewCon,children:h})})||(0,l.jsxs)(l.Fragment,{children:[(2==I||3==I)&&(0,l.jsxs)(r.G7,{style:{paddingBottom:x+"rpx"},className:c.scrollViewCon,children:[h,(0,l.jsx)(r.G7,{className:c.infinite_scroll,children:2==I&&(0,l.jsxs)(r.G7,{className:c.loading_more,children:["加载中",(0,l.jsx)(a.Z,{})]})||(0,l.jsx)(r.G7,{className:c.noMore,children:"没有更多数据了"})})]}),0==I&&(0,l.jsx)(d,{}),1==I&&(0,l.jsx)(d,{loadingIcon:!1,title:"暂无数据"})]}),(0,l.jsx)(r.G7,{className:"common_safe_area_y"})]})})}))},7046:function(e,n,t){t.d(n,{Z:function(){return s}});var r=t(1413),o=t(1515),c=t(9792),a="index-module__loading___B1mw6",i="index-module__loading__ring___Jbv9p",u=t(5513),s=(0,c.memo)((function(e){var n=e.width,t=void 0===n?60:n,s=e.color,l=void 0===s?"#6190e8":s,d=(0,c.useMemo)((function(){var e={};return t>0&&(e={width:t+"rpx",height:t+"rpx"}),l&&(e=(0,r.Z)((0,r.Z)({},e),{},{borderColor:l+" transparent transparent"})),e}),[t,l]);return(0,u.jsxs)(o.G7,{className:a,style:d,children:[(0,u.jsx)(o.G7,{style:d,className:i}),(0,u.jsx)(o.G7,{style:d,className:i}),(0,u.jsx)(o.G7,{style:d,className:i})]})}))},7594:function(e,n,t){t.d(n,{Z:function(){return s}});var r=t(4942),o=t(1515),c=t(6408),a=t.n(c),i={common_safe_area_y:"index-module__common_safe_area_y___IUnb9","full-100":"index-module__full-100___QgnTD","color-blue":"index-module__color-blue___EaomM","color-yellow":"index-module__color-yellow___ohnSb","color-green":"index-module__color-green___u2feZ","color-grey":"index-module__color-grey___LZcX1","color-white":"index-module__color-white___VRC55",button:"index-module__button___DRDXf","button--normal":"index-module__button--normal___axfNp","button--small":"index-module__button--small____7C1y","button--disabled":"index-module__button--disabled___B2gA4","button--primary":"index-module__button--primary___djD87","button--danger":"index-module__button--danger___t4BI4","button--warning":"index-module__button--warning___PMRGc","button--round":"index-module__button--round___soP20","button--circle":"index-module__button--circle___Ep2Qy","button--plain":"index-module__button--plain___igM6X","button--text":"index-module__button--text___fdjur"},u=t(5513),s=function NormalButton(e){var n=e.type,t=void 0===n?"primary":n,c=e.size,s=void 0===c?"normal":c,l=e.round,d=void 0!==l&&l,_=e.disabled,m=void 0!==_&&_,f=e.children,h=e.onClick,v=e.plain,p=void 0!==v&&v,g=e.circle,x=void 0!==g&&g,b=e.customStyles,y=void 0===b?{}:b,w=e.customClassName,S=void 0===w?"":w;return(0,u.jsx)(o.G7,{className:a()(i.button,function getClassName(){var e;return e={},(0,r.Z)(e,i["button--disabled"],m),(0,r.Z)(e,i["button--".concat(s)],s),(0,r.Z)(e,i["button--".concat(t)],t),(0,r.Z)(e,i["button--round"],d),(0,r.Z)(e,i["button--plain"],p),(0,r.Z)(e,i["button--circle"],x),e}(),y,S),onClick:function handleClick(e){m||h&&h(e)},children:(0,u.jsx)(o.xv,{className:i["button--text"],children:f})})}},5854:function(e,n,t){t.d(n,{Z:function(){return d}});var r=t(4942),o=t(1515),c={common_safe_area_y:"index-module__common_safe_area_y___AN51l","full-100":"index-module__full-100___usSFL","color-blue":"index-module__color-blue___HimgA","color-yellow":"index-module__color-yellow___jZv1z","color-green":"index-module__color-green___ZUNQt","color-grey":"index-module__color-grey___RMBDP","color-white":"index-module__color-white___yTFJ6",drawer_main:"index-module__drawer_main___lbmEH",drawer:"index-module__drawer___b67So",drawer_mask:"index-module__drawer_mask___cYXpj",drawer_container:"index-module__drawer_container___x7Bht",drawer_container_title:"index-module__drawer_container_title___PCAaO",common_close_btn_icon:"index-module__common_close_btn_icon____iQdY",drawer_container_active:"index-module__drawer_container_active___tyyQO",drawer_mask_active:"index-module__drawer_mask_active___bzXhl",drawer_active:"index-module__drawer_active___UHfch",drawer_container_bottom:"index-module__drawer_container_bottom___ZVS2f",drawer_container_top:"index-module__drawer_container_top___JhJLo",drawer_container_right:"index-module__drawer_container_right___wgZlw"},a=t(6408),i=t.n(a),u=t(9792),s=t(3051),l=t(5513),d=(0,u.memo)((function(e){var n=e.title,t=void 0===n?"标题":n,a=e.show,d=void 0!==a&&a,_=e.showTitle,m=void 0===_||_,f=e.onClose,h=e.showIconButton,v=void 0!==h&&h,p=e.children,g=e.position,x=void 0===g?"bottom":g,b=e.animationEnd,y=(0,u.useRef)(null);return(0,u.useEffect)((function(){d?y.current=setTimeout((function(){null==b||b()}),260):clearTimeout(y.current)}),[d]),(0,u.useEffect)((function(){return function(){clearTimeout(y.current)}}),[]),(0,l.jsx)(l.Fragment,{children:(0,l.jsx)(o.G7,{className:c.drawer_main,children:(0,l.jsx)(o.G7,{catchMove:!0,className:"".concat(c.drawer," ").concat(d?c.drawer_active:""),children:(0,l.jsx)(o.G7,{className:i()(c.drawer_mask,(0,r.Z)({},c.drawer_mask_active,d)),onClick:function onClick(){return null==f?void 0:f()},children:(0,l.jsxs)(o.G7,{className:i()(c.drawer_container,c["drawer_container_"+x],(0,r.Z)({},c.drawer_container_active,d)),onClick:function onClick(e){return e.stopPropagation()},children:[m&&(0,l.jsx)(o.G7,{className:c.drawer_container_title,children:t}),v&&(0,l.jsx)(o.G7,{className:c.common_close_btn_icon,children:(0,l.jsx)(s.Z,{onClose:function onClose(){return null==f?void 0:f()}})}),(0,l.jsx)(o.G7,{className:c.drawer_container_context,children:d&&p}),(0,l.jsx)(o.G7,{className:"common_safe_area_y"})]})})})})})}))},5032:function(e,n,t){t.d(n,{Z:function(){return x}});var r=t(885),o=t(1515),c="index-module__search_main___zhyPq",a="index-module__icon_a_sousuo1_self___vLbP7",i="index-module__search_con___uJS5k",u="index-module__search_closeBtn___DyHwM",s="index-module__btn___KOFFr",l="index-module__icon_inner___OAA64",d="index-module__icon_out___d9xxy",_="index-module__input_out___Kmb8U",m=t(3051),f=t(6408),h=t.n(f),v=t(7227),p=t(9792),g=t(5513),x=(0,p.memo)((0,p.forwardRef)((function(e,n){var t=e.clickOnSearch,f=e.changeOnSearch,x=e.disabled,b=void 0!==x&&x,y=e.placeholder,w=void 0===y?"输入搜索内容":y,S=e.showIcon,C=void 0===S||S,k=e.showBtn,Z=void 0!==k&&k,I=e.btnStyle,T=void 0===I?{}:I,j=e.placeIcon,A=void 0===j?"inner":j,N=e.btnTitle,E=void 0===N?"搜索":N,L=e.debounceTime,R=void 0===L?0:L,G=e.defaultValue,P=void 0===G?"":G,D=e.children,F=(0,p.useState)(""),U=(0,r.Z)(F,2),O=U[0],B=U[1],z=(0,p.useRef)(0);(0,p.useEffect)((function(){B(P)}),[P]),(0,p.useEffect)((function(){z.current=R}),[R]);(0,p.useImperativeHandle)(n,(function(){return{clearInput:M}}));var M=function clearInput(){B(""),null==f||f("")},Q=(0,v.Ds)((function(e){B(e),null==f||f(e)}),z.current),K=function onSearch(){null==t||t(O)};return(0,g.jsx)(g.Fragment,{children:(0,g.jsxs)(o.G7,{className:c,children:[(0,g.jsxs)(o.G7,{className:i,children:[C&&(0,g.jsx)(o.G7,{className:h()("iconfont","icon-sousuo",a,"inner"==A?l:d)}),(0,g.jsx)(o.II,{placeholderStyle:"color:#ABABAB; font-size:26rpx",onConfirm:K,className:h()("out"==A&&_),disabled:b,value:O,placeholder:w,onInput:function onInput(e){return function onInputEven(e){var n=e.detail.value;Q(n)}(e)}}),!!O&&(0,g.jsx)(o.G7,{className:u,children:(0,g.jsx)(m.Z,{onClose:function onClose(){return M()},styleObj:{width:"20rpx",height:"20rpx",backgroundColor:"#fff",border:"0"}})})]}),Z&&(0,g.jsx)(o.G7,{style:T,className:s,onClick:K,children:E}),D]})})})))},4119:function(e,n,t){var r;t.d(n,{g:function(){return r}}),function(e){e.SET_SELECTED="setSelected"}(r||(r={}))},1660:function(e,n,t){var r;t.d(n,{S:function(){return r}}),function(e){e.SET_USERINFO="setUserInfo",e.SET_ADMINUSERINFO="setAdminUserInfo",e.SET_TOKEN="setToken",e.SET_SESSIONKEY="setSessionkey",e.SET_SORTCODE="setSortCode",e.CLEAR_TOKEN="clearToken",e.CLEAR_SESSIONKEY="clearSessionkey",e.CLEAR_USERINFO="clearUserInfo",e.CLEAR_ADMINUSERINFO="clearAdminUserInfo",e.CLEAR_SORTCODE="clearSortCode",e.LOGIN_STATUS="loginStatus"}(r||(r={}))},9194:function(e,n,t){t.d(n,{v:function(){return o}});var r=t(2934),o=r.useSelector},1894:function(e,n,t){t.d(n,{Z:function(){return contextBlueTooth},E:function(){return x}});var r=t(2982),o=t(4165),c=t(5861),a=t(1413),i=t(885),u=t(9792),s=t.n(u),l=t(2535),d=t.n(l),_=t(5671),m=t(3144),f=t(4942);function uint32ToUint8Array(e){return new Uint8Array(new Uint32Array([e]).buffer)}function uint8ArrayToFloat32(e){return new Float32Array(e.buffer)[0]}function waitFor(e){return new Promise((function(n){setTimeout(n,e)}))}var h=function(){function Command(e,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];(0,_.Z)(this,Command),(0,f.Z)(this,"responseSize",0),(0,f.Z)(this,"content",new Uint8Array(0)),(0,f.Z)(this,"response",new Uint8Array(0)),(0,f.Z)(this,"timeout",3e3),(0,f.Z)(this,"needSign",!0),e instanceof Uint8Array?this.content=e:this.content=new Uint8Array(e),this.responseSize=n,"number"==typeof t&&t>=0&&(this.timeout=t),this.needSign=r}return(0,m.Z)(Command,[{key:"data",get:function get(){if(0===this.content.length)throw new Error("正文内容不能为空");var e=[],n=new Uint8Array(this.content.buffer);this.needSign&&(n[n.length-1]=Command.getSign(n));for(var t=0;t<n.length;t+=20)e.push(n.slice(t,t+20).buffer);return e}},{key:"isComplete",get:function get(){return this.response.length>=this.responseSize}},{key:"isValid",get:function get(){return Command.getSign(this.response)===this.response[this.response.length-1]}},{key:"fillResponse",value:function fillResponse(e){this.response=new Uint8Array([].concat((0,r.Z)(this.response),(0,r.Z)(new Uint8Array(e))))}}],[{key:"getSign",value:function getSign(e){var n=e instanceof Uint8Array?e:new Uint8Array(e),t=0;return n.slice(0,n.length-1).forEach((function(e){return t+=e})),new Uint8Array([t])[0]}},{key:"measure",value:function measure(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;Command.measureId+=1;var n=uint32ToUint8Array(Command.measureId);return new Command([187,1,e].concat((0,r.Z)(n),[0,255,0]),10,1500)}},{key:"getLab",value:function getLab(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Command([187,3,e,0,0,0,0,0,255,0],20,1500)}},{key:"getRGB",value:function getRGB(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Command([187,4,e,0,0,0,0,0,255,0],20,1500)}},{key:"getSpectral",value:function getSpectral(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return new Command([187,2,16+e,0,0,0,0,0,255,0],200,5e3)}},{key:"whiteCalibrate",value:function whiteCalibrate(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new Command([187,17,e,0,0,0,0,0,255,0],10,1500)}},{key:"blackCalibrate",value:function blackCalibrate(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return new Command([187,16,e,0,0,0,0,0,255,0],10,1500)}}]),Command}();(0,f.Z)(h,"measureId",1),(0,f.Z)(h,"WakeUp",new h([240],0,0,!1)),(0,f.Z)(h,"GetCalibrationInf",new h([187,30,0,0,0,0,0,0,255,0],20,1500)),(0,f.Z)(h,"GetDeviceInf",new h([187,18,1,0,0,0,0,0,255,0],200,5e3));var v=t(5513),p=s().createContext(null),g={listeners:new Set,discovering:!1,available:!0,connected:null,connecting:null,serviceRule:/^0000FFE0/,serviceId:null,characteristicRule:/^0000FFE1/,characteristicId:null,command:null,responseResolve:null,responseReject:null,responseTimer:null,debug:!0,devices:[],deviceLab:null},contextBlueTooth=function(e){var n=(0,u.useRef)(g),t=(0,u.useState)(n.current),s=(0,i.Z)(t,2),l=s[0],_=s[1],m=function changeStatus(e){n.current=(0,a.Z)((0,a.Z)({},n.current),e),_((0,a.Z)({},n.current))},f=function(){var e=(0,c.Z)((0,o.Z)().mark((function _callee2(){return(0,o.Z)().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,x();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),m({available:!1});case 8:d().onBluetoothAdapterStateChange((function(e){b({type:"stateUpdate",detail:e})})),d().onBLEConnectionStateChange((function(e){b({type:e.connected?"connected":"disconnect",detail:e})})),d().onBLECharacteristicValueChange((function(e){return notifySubscriber(e.value)})),y(function(){var e=(0,c.Z)((0,o.Z)().mark((function _callee(e){return(0,o.Z)().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if("stateUpdate"!==e.type){t.next=4;break}m({discovering:e.detail.discovering,available:e.detail.available}),t.next=17;break;case 4:if("disconnect"!==e.type||!n.current.connected||n.current.connected.deviceId!==e.detail.deviceId){t.next=9;break}m({connected:null,serviceId:null,characteristicId:null,deviceLab:null,devices:[]}),d().showToast({icon:"none",title:"蓝牙连接已断开"}),t.next=17;break;case 9:if("connected"!==e.type||!n.current.connecting){t.next=14;break}m({connected:n.current.connecting,connecting:null}),d().showToast({title:"蓝牙已连接"}),t.next=17;break;case 14:if("measure"!==e.type){t.next=17;break}return t.next=17,measureAndGetLab();case 17:case"end":return t.stop()}}),_callee)})));return function(n){return e.apply(this,arguments)}}());case 12:case"end":return e.stop()}}),_callee2,null,[[0,5]])})));return function init(){return e.apply(this,arguments)}}(),x=function openAdapter(){return new Promise((function(e,n){d().openBluetoothAdapter({success:e,fail:n})}))},b=function emit(e){n.current.listeners.forEach((function(n){n&&n(e)}))},y=function subscribe(e){e&&m({listeners:n.current.listeners.add(e)})},w=function getDevices(e){e.devices.forEach((function(e){/^CM/.test(e.name)&&!n.current.devices.find((function(n){return n.deviceId===e.deviceId}))&&m({devices:[].concat((0,r.Z)(n.current.devices),[e])})}))},S=function(){var e=(0,c.Z)((0,o.Z)().mark((function _callee3(e){return(0,o.Z)().wrap((function _callee3$(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,m({connecting:e}),n.next=5,createConnection(e.deviceId);case 5:return n.next=7,discoverService(e.deviceId);case 7:return n.next=9,discoverCharacteristic(e.deviceId);case 9:return n.next=11,notifyCharacteristicValueChange(e.deviceId);case 11:n.next=18;break;case 13:throw n.prev=13,n.t0=n.catch(0),m({connecting:null}),d().showToast({icon:"none",title:"蓝牙连接失败"}),n.t0;case 18:case"end":return n.stop()}}),_callee3,null,[[0,13]])})));return function connect(n){return e.apply(this,arguments)}}(),C=function(){var e=(0,c.Z)((0,o.Z)().mark((function _callee4(){return(0,o.Z)().wrap((function _callee4$(e){for(;;)switch(e.prev=e.next){case 0:if(n.current.connected||n.current.connecting){e.next=2;break}return e.abrupt("return");case 2:if(!n.current.connected){e.next=7;break}return e.next=5,closeConnection(n.current.connected.deviceId);case 5:resetCommand(),m({connected:null,serviceId:null,characteristicId:null,devices:[],deviceLab:null});case 7:if(!n.current.connecting){e.next=11;break}return e.next=10,closeConnection(n.current.connecting.deviceId);case 10:m({connecting:null});case 11:case"end":return e.stop()}}),_callee4)})));return function disconnect(){return e.apply(this,arguments)}}();function createConnection(e){return new Promise((function(n,t){d().createBLEConnection({deviceId:e,timeout:2e3,success:n,fail:t})}))}function closeConnection(e){return new Promise((function(n,t){d().closeBLEConnection({deviceId:e,success:n,fail:t})}))}function discoverService(e){return new Promise((function(t,r){d().getBLEDeviceServices({deviceId:e,success:function success(e){var o=e.services.find((function(e){return n.current.serviceRule.test(e.uuid)}));o?(m({serviceId:o.uuid}),t(o)):r(new Error("服务不可用"))},fail:r})}))}function discoverCharacteristic(e){return new Promise((function(t,r){d().getBLEDeviceCharacteristics({deviceId:e,serviceId:n.current.serviceId,success:function success(e){var o=e.characteristics.find((function(e){return n.current.characteristicRule.test(e.uuid)}));o?(m({characteristicId:o.uuid}),t(o)):r(new Error("特征不可用"))},fail:r})}))}function notifyCharacteristicValueChange(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return new Promise((function(r,o){d().notifyBLECharacteristicValueChange({deviceId:e,serviceId:n.current.serviceId,characteristicId:n.current.characteristicId,state:t,success:r,fail:o})}))}function notifySubscriber(e){if(n.current.command)n.current.debug,n.current.command.fillResponse(e),n.current.command.isComplete&&(n.current.command.isValid&&n.current.responseResolve?n.current.responseResolve(n.current.command.response):n.current.command.isValid||n.current.responseReject(new Error("无效数据")),resetCommand());else{var t=new Uint8Array(e);if(187===t[0]&&1===t[1]&&0===t[3]){var r={type:"measure",detail:{mode:t[2]}};b(r)}}}function exec(e){return new Promise(function(){var t=(0,c.Z)((0,o.Z)().mark((function _callee5(t,r){var c,a;return(0,o.Z)().wrap((function _callee5$(o){for(;;)switch(o.prev=o.next){case 0:if(!n.current.command){o.next=4;break}r(new Error("正在执行其他命令")),o.next=20;break;case 4:o.prev=4,n.current.command=e,c=e.data,a=0;case 8:if(!(a<c.length)){o.next=14;break}return o.next=11,sendData(c[a]);case 11:a++,o.next=8;break;case 14:e.responseSize<=0?(t(!0),resetCommand()):(n.current.responseReject=r,n.current.responseResolve=t,n.current.responseTimer=setTimeout((function(){r(new Error("命令响应超时")),resetCommand()}),e.timeout)),o.next=20;break;case 17:o.prev=17,o.t0=o.catch(4),r(o.t0);case 20:case"end":return o.stop()}}),_callee5,null,[[4,17]])})));return function(e,n){return t.apply(this,arguments)}}())}function sendData(e){return n.current.debug,new Promise((function(t,r){d().writeBLECharacteristicValue({deviceId:n.current.connected.deviceId,serviceId:n.current.serviceId,characteristicId:n.current.characteristicId,value:e,success:t,fail:r})}))}function resetCommand(){n.current.responseTimer&&clearTimeout(n.current.responseTimer),m({command:null,responseResolve:null,responseReject:null,responseTimer:null})}function measure(){return _measure.apply(this,arguments)}function _measure(){return _measure=(0,c.Z)((0,o.Z)().mark((function _callee6(){var e,n=arguments;return(0,o.Z)().wrap((function _callee6$(t){for(;;)switch(t.prev=t.next){case 0:return e=n.length>0&&void 0!==n[0]?n[0]:0,t.next=4,exec(h.WakeUp);case 4:return t.next=7,waitFor(50);case 7:return t.next=10,exec(h.measure(e));case 10:return t.abrupt("return",t.sent);case 11:case"end":return t.stop()}}),_callee6)}))),_measure.apply(this,arguments)}function getLab(){return _getLab.apply(this,arguments)}function _getLab(){return _getLab=(0,c.Z)((0,o.Z)().mark((function _callee7(){var e,n,t=arguments;return(0,o.Z)().wrap((function _callee7$(r){for(;;)switch(r.prev=r.next){case 0:return e=t.length>0&&void 0!==t[0]?t[0]:0,r.next=3,exec(h.WakeUp);case 3:return r.next=5,waitFor(50);case 5:return r.next=7,exec(h.getLab(e));case 7:return n=r.sent,r.abrupt("return",{L:uint8ArrayToFloat32(n.slice(5,9)),a:uint8ArrayToFloat32(n.slice(9,13)),b:uint8ArrayToFloat32(n.slice(13,17))});case 9:case"end":return r.stop()}}),_callee7)}))),_getLab.apply(this,arguments)}function measureAndGetLab(){return _measureAndGetLab.apply(this,arguments)}function _measureAndGetLab(){return _measureAndGetLab=(0,c.Z)((0,o.Z)().mark((function _callee8(){var e,n,t=arguments;return(0,o.Z)().wrap((function _callee8$(r){for(;;)switch(r.prev=r.next){case 0:return e=t.length>0&&void 0!==t[0]?t[0]:0,r.next=3,measure(e);case 3:return r.next=5,waitFor(50);case 5:return r.next=7,getLab(e);case 7:return n=r.sent,m({deviceLab:n}),r.abrupt("return",n);case 11:case"end":return r.stop()}}),_callee8)}))),_measureAndGetLab.apply(this,arguments)}return(0,v.jsx)(p.Provider,{children:e.children,value:{init:f,state:l,startScan:function startScan(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return m({devices:[]}),d().onBluetoothDeviceFound(w),new Promise((function(n,t){d().startBluetoothDevicesDiscovery({allowDuplicatesKey:!0,success:n,fail:t}),e>0&&setTimeout((function(){d().offBluetoothDeviceFound(w),d().stopBluetoothDevicesDiscovery()}),e)}))},measureAndGetLab:measureAndGetLab,getAdapterState:function getAdapterState(){return new Promise((function(e,n){d().getBluetoothAdapterState({success:e,fail:n})}))},connect:S,disconnect:C}})},x=function useBluetooth(){var e=s().useContext(p);return e?(0,a.Z)({},e):{}}},1948:function(e,n,t){t.d(n,{Q:function(){return v}});var r=t(4165),o=t(5861),c=t(885),a=t(1413),i=t(2535),u=t.n(i),s=t(9792),l=t(7903),d=t(3929),_=t(8748),m=t.n(_),f=!1,useLoginRequest=function(){var e=(0,s.useRef)({success:!1,data:null,msg:"",code:null,loading:!1}),n=(0,d.Z)(),t=n.setToken,c=n.setSessionKey,a=(0,i.useRouter)(),_=function(){var n=(0,o.Z)((0,r.Z)().mark((function _callee(n){var t,o,c,a,i,s;return(0,r.Z)().wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:return t={url:l._n+"/v1/mall/login",header:{Platform:3,Appid:l.Kj},method:"post",data:{js_code:n}},r.prev=1,r.next=4,u().request(t);case 4:o=r.sent,c=o.data,a=c.code,i=c.data,s=c.msg,200===o.statusCode?(e.current.success=0===a,e.current.code=a,e.current.msg=s,e.current.data=i):u().showToast({title:"错误:登录失败",icon:"none"}),r.next=13;break;case 9:r.prev=9,r.t0=r.catch(1),u().showToast({title:"错误:登录失败",icon:"none"});case 13:return r.abrupt("return",e.current);case 14:case"end":return r.stop()}}),_callee,null,[[1,9]])})));return function fetchDataLogin(e){return n.apply(this,arguments)}}();return{login:function login(){return new Promise((function(e,n){if(f)return n(!1);var i;f=!0,u().login({success:(i=(0,o.Z)((0,r.Z)().mark((function _callee2(o){var i,s,l,d,h;return(0,r.Z)().wrap((function _callee2$(r){for(;;)switch(r.prev=r.next){case 0:if(!o.code){r.next=10;break}return r.next=3,_(o.code);case 3:i=r.sent,s=i.data,l=i.success,d=i.msg,l?(t(s.token),c(s.session_key),e(s),delete(h=a.params).$taroTimestamp,"/pages/index/index"===a.path||"/pages/user/index"===a.path?u().reLaunch({url:a.path+"?"+m().stringify(h)}):u().redirectTo({url:a.path+"?"+m().stringify(h)})):(u().showToast({title:"登录失败",icon:"none"}),n(d)),r.next=12;break;case 10:n(o.errMsg);case 12:f=!1;case 13:case"end":return r.stop()}}),_callee2)}))),function success(e){return i.apply(this,arguments)}),fail:function fail(e){n(e),f=!1}})}))}}},h=function showStatus(e){var n="";switch(e){case 400:n="请求错误(400)";break;case 401:n="未授权,请重新登录(401)";break;case 403:n="拒绝访问(403)";break;case 404:n="请求出错(404)";break;case 408:n="请求超时(408)";break;case 500:n="服务器错误(500)";break;case 501:n="服务未实现(501)";break;case 502:n="网络错误(502)";break;case 503:n="服务不可用(503)";break;case 504:n="网络超时(504)";break;case 505:n="HTTP版本不受支持(505)";break;default:n="连接出错(".concat(e,")!")}return"".concat(n,",请检查网络或联系管理员!")},v=function useRequest(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{url:"/",method:"get",type:"json",data:{},page:1,pageSize:24,pagination:!1,base_url:"",apiMsgStatus:!0};e.url="".concat(e.base_url||l._n).concat(e.url);var n={code:null,success:!1,data:{},msg:"",loading:!1,error:null,query:{},filter:null,sort:"",total:0,multiple:!0,count:0,token:""},t=(0,s.useRef)((0,a.Z)({},n)),i=(0,s.useState)((0,a.Z)({},t.current)),_=(0,c.Z)(i,2),f=_[0],v=_[1],p=(0,d.Z)(),g=p.removeToken,x=(p.removeSessionKey,p.removeUserInfo),b=useLoginRequest(),y=b.login,w=function(){var n=(0,o.Z)((0,r.Z)().mark((function _callee(n){var o,c,i,s,d,_,f,p,b,w;return(0,r.Z)().wrap((function _callee$(r){for(;;)switch(r.prev=r.next){case 0:return t.current.loading=!0,v((function(e){return(0,a.Z)((0,a.Z)({},e),{},{loading:!0})})),t.current.query=(0,a.Z)((0,a.Z)((0,a.Z)((0,a.Z)({},n),e.pagination&&{page:t.current.page,size:t.current.pageSize}),t.current.filter),t.current.sort),r.prev=3,i=u().getStorageSync("token"),s=(0,a.Z)((0,a.Z)((0,a.Z)({},e),{header:{Platform:3,Appid:l.Kj,Authorization:i||t.current.token}}),"GET"==(null===(o=e.method)||void 0===o?void 0:o.toUpperCase())?{data:t.current.query}:{data:"FORMDATA"==(null===(c=e.type)||void 0===c?void 0:c.toUpperCase())?m().stringify(t.current.query):t.current.query}),r.next=8,u().request(s);case 8:d=r.sent,_=d.statusCode,f=d.data,p=f.code,b=f.msg,w=f.data,200===_?(t.current.success=0===p,t.current.code=p,t.current.msg=b,t.current.data=w,t.current.total=null!=w&&w.list?null==w?void 0:w.total:0,0!==p&&!1!==e.apiMsgStatus&&u().showToast({title:"".concat(b),icon:"none"})):401===_?(g(),x(),y().catch((function(e){e&&u().reLaunch({url:"/pages/login/index"})}))):u().showToast({title:"错误:".concat(h(_)),icon:"none"}),r.next=20;break;case 14:r.prev=14,r.t0=r.catch(3),t.current.success=!1,t.current.error=!0,t.current.msg=r.t0.errMsg;case 20:return t.current.error=!1,t.current.loading=!1,v((function(){return(0,a.Z)({},t.current)})),r.abrupt("return",t.current);case 24:case"end":return r.stop()}}),_callee,null,[[3,14]])})));return function fetchData(e){return n.apply(this,arguments)}}();return{fetchData:w,state:f}}},3929:function(e,n,t){var r=t(2934),o=t(1660),c=t(9194);n.Z=function(){var e=(0,c.v)((function(e){return e.userInfoData})),n=(0,r.useDispatch)();return{setToken:function setToken(e){n({type:o.S.SET_TOKEN,data:{token:e}})},setUserInfo:function setUserInfo(e){n({type:o.S.SET_USERINFO,data:{userInfo:e}})},setAdminUserInfo:function setAdminUserInfo(e){n({type:o.S.SET_ADMINUSERINFO,data:{adminUserInfo:e}})},setSessionKey:function setSessionKey(e){n({type:o.S.SET_SESSIONKEY,data:{session_key:e}})},removeUserInfo:function removeUserInfo(){n({type:o.S.CLEAR_USERINFO})},removeToken:function removeToken(){n({type:o.S.CLEAR_TOKEN})},removeSessionKey:function removeSessionKey(){n({type:o.S.CLEAR_SESSIONKEY})},setSortCode:function setSortCode(e){n({type:o.S.SET_SORTCODE,data:{sort_code:e}})},userInfo:e}}}}]);