1 line
38 KiB
JavaScript
1 line
38 KiB
JavaScript
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[5425],{8698:function(m,C,T){var Z=T(2180),U=T(1413),L=T(4165),B=T(5861),K=T(9439),G=T(1515),F=T(2954),H=T.n(F),V=T(7294),W=T.n(V),$=T(4184),X=T.n($),Q="index-module__shopping___rSsIK",q="index-module__shopping--topBar___NgzyU",J="index-module__shopping--context___wd0NG",Y="index-module__shopping__list__container___eQIei",ee="index-module__bottomBar___fVCAl",te="index-module__flexBox___XHnXI",ne="index-module__icon--manage--cancel___EBDNt",re=T(4942),oe=T(3433),ie=T(5671),le=T(3144),ce=new F.Events,ue=function(){function ShoppingStore(m){(0,ie.Z)(this,ShoppingStore),(0,re.Z)(this,"store",{}),(0,re.Z)(this,"observers",[]),m&&this.updateStore(m)}return(0,le.Z)(ShoppingStore,[{key:"updateStore",value:function updateStore(m){this.store=m}},{key:"subscribe",value:function subscribe(m){var C=this;return this.observers.push(m),function(){C.observers=C.observers.filter((function(C){return m!==C}))}}},{key:"notify",value:function notify(m){this.observers.forEach((function(C){C(m)}))}}]),ShoppingStore}(),ae={common_safe_area_y:"index-module__common_safe_area_y___fWsCw","flex-col":"index-module__flex-col___Ra0HZ","flex-row":"index-module__flex-row___a2x9u","justify-between":"index-module__justify-between___CfLIX","justify-center":"index-module__justify-center___ve6h7","items-center":"index-module__items-center___px4zj","flex-item":"index-module__flex-item____aoyw","full-100":"index-module__full-100___hA5V5","color-blue":"index-module__color-blue___Dxo4G","color-yellow":"index-module__color-yellow___lCuXN","color-green":"index-module__color-green___dJNqM","color-grey":"index-module__color-grey___cK2Om","color-white":"index-module__color-white___QbWlK","s-w":"index-module__s-w___ZJ0be","s-e":"index-module__s-e___iKnIo",filter:"index-module__filter___sdosw",container:"index-module__container___8yMGa",colorKindItem:"index-module__colorKindItem___unIT2",colorKindItem__left:"index-module__colorKindItem__left___T53SU","colorKindItem__left--image":"index-module__colorKindItem__left--image___mmuUp",colorKindItem__center:"index-module__colorKindItem__center___ejsbq","colorKindItem__center--title":"index-module__colorKindItem__center--title___z6WQr","colorKindItem__center--ID":"index-module__colorKindItem__center--ID___vq6as","colorKindItem__center--description":"index-module__colorKindItem__center--description___obrWy",colorKindItem__right:"index-module__colorKindItem__right___jp_VV","colorKindItem__right--price":"index-module__colorKindItem__right--price___Fu6Pv","colorKindItem__right--yuanPrice":"index-module__colorKindItem__right--yuanPrice___hdVun",checkbox:"index-module__checkbox___IxTs9",selected:"index-module__selected___DiFAO"},se=T(6504),de=T(7018),_e=T(7227),fe=T(4812),me=T(4547),pe=T(3263),he=T(3407),xe=T(9498),ve=T(545),ge=T(5893),ye=function ColorKindItem(m){console.log("rerender component ColorKindItem",m);var C=m.purchaserId,T=m.itemData,Z=m.checked,U=(0,xe.BL)({defaultValue:Z,value:Z}),F=(0,K.Z)(U,2),H=F[0],W=F[1],$=(0,V.useRef)({roll:T.roll,length:T.length}),Q=function formatCount(m){return m.sale_mode==me.p.Bulk?m.roll:(0,fe.N6)(m.length)},q=(0,V.useState)(Q(T)),J=(0,K.Z)(q,2),Y=J[0],ee=J[1],te=function formatPrice(m){return Number((0,fe.yb)(m))},ne=(0,pe.uV)().fetchData,re=(0,V.useCallback)((0,_e.Ds)(function(){var m=(0,B.Z)((0,L.Z)().mark((function _callee(m){var Z;return(0,L.Z)().wrap((function _callee$(U){for(;;)switch(U.prev=U.next){case 0:if(console.log("num===>",m),!(m<ve.F[T.sale_mode].minNum)){U.next=3;break}return U.abrupt("return");case 3:return Z={roll:0,length:0},T.sale_mode===me.p.Bulk?Z.roll=Math.trunc(m):Z.length=(0,fe.x2)(m),U.next=7,ne({id:T.id,roll:Z.roll,length:Z.length});case 7:U.sent.success?($.current=Z,ce.trigger("FetchSpecificPurchaser",C)):ee(Q(T));case 9:case"end":return U.stop()}}),_callee)})));return function(C){return m.apply(this,arguments)}}(),300),[T]),oe=(0,V.useCallback)((function(m){return{lab:m.lab,rgb:m.rgb,texture_url:m.product_color_texture_url}}),[]);return(0,V.useEffect)((function(){console.log("itemData==>",T),ee(Q(T))}),[T.roll,T.length]),(0,ge.jsxs)(se.Z,{status:H,onSelect:function handleSelect(){console.log("currentCount==>",$.current,T);var m={id:null==T?void 0:T.id,estimate_amount:T.estimate_amount,product_code:T.product_code,product_color_code:T.product_color_code,sale_mode:T.sale_mode,count:T.sale_mode===me.p.Bulk?$.current.roll:Number((0,fe.N6)($.current.length))};ce.trigger("updatePurchaserMultipleSelection",C,m,"add",null==T?void 0:T.id),W(!0)},onClose:function handleClose(){ce.trigger("updatePurchaserMultipleSelection",C,null,"delete",T.id),W(!1)},customClassName:X()(ae.checkbox,H?ae.selected:""),customTextClass:ae.colorKindItem,children:[(0,ge.jsx)(G.G7,{className:ae.colorKindItem__left,children:(0,ge.jsx)(he.Z,{suffix:"!w200",value:oe(T)})}),(0,ge.jsxs)(G.G7,{className:ae.colorKindItem__center,children:[(0,ge.jsxs)(G.xv,{className:ae["colorKindItem__center--title"],children:[T.product_code,"# ",T.product_name]}),(0,ge.jsxs)(G.G7,{className:ae["colorKindItem__center--detail"],children:[(0,ge.jsx)(G.xv,{className:ae["colorKindItem__center--ID"],children:T.product_color_code}),(0,ge.jsx)(G.xv,{className:ae["colorKindItem__center--description"],children:T.product_color_name})]})]}),(0,ge.jsxs)(G.G7,{className:ae.colorKindItem__right,children:[(0,ge.jsxs)(G.G7,{className:ae["colorKindItem__right--price"],children:["¥ ",te(T.sale_price),"/",T.sale_mode==me.p.Plate?"米":"kg"]}),T.sale_mode===me.p.Bulk&&(null==T?void 0:T.standard_sale_price)!==(null==T?void 0:T.sale_price)&&(0,ge.jsxs)(G.G7,{className:ae["colorKindItem__right--yuanPrice"],children:["¥ ",te(null==T?void 0:T.standard_sale_price),"/",T.sale_mode==me.p.Plate?"米":"kg"]}),(0,ge.jsx)(G.G7,{className:ae["colorKindItem__right--counter"],children:(0,ge.jsx)(de.Z,{onBlue:re,defaultNum:Y,onChange:function handleCountChange(m){ee(m)},step:T.step,digits:T.digits,onClickBtn:re,unit:function formatUnit(m){return m.sale_mode==me.p.Bulk?"条":"米"}(T),minNum:ve.F[T.sale_mode].minNum,maxNum:ve.F[T.sale_mode].maxNum})})]})]})},be=(0,V.memo)(ye);function n(m){for(var C=arguments.length,T=Array(C>1?C-1:0),Z=1;Z<C;Z++)T[Z-1]=arguments[Z];var U=ke[m],L=U?"function"==typeof U?U.apply(null,T):U:"unknown error nr: "+m;throw Error("[Immer] "+L)}function r(m){return!!m&&!!m[Ie]}function t(m){var C;return!!m&&(function(m){if(!m||"object"!=typeof m)return!1;var C=Object.getPrototypeOf(m);if(null===C)return!0;var T=Object.hasOwnProperty.call(C,"constructor")&&C.constructor;return T===Object||"function"==typeof T&&Function.toString.call(T)===Ae}(m)||Array.isArray(m)||!!m[De]||!!(null===(C=m.constructor)||void 0===C?void 0:C[De])||s(m)||v(m))}function i(m,C,T){void 0===T&&(T=!1),0===o(m)?(T?Object.keys:Ne)(m).forEach((function(Z){T&&"symbol"==typeof Z||C(Z,m[Z],m)})):m.forEach((function(T,Z){return C(Z,T,m)}))}function o(m){var C=m[Ie];return C?C.i>3?C.i-4:C.i:Array.isArray(m)?1:s(m)?2:v(m)?3:0}function u(m,C){return 2===o(m)?m.has(C):Object.prototype.hasOwnProperty.call(m,C)}function a(m,C){return 2===o(m)?m.get(C):m[C]}function f(m,C,T){var Z=o(m);2===Z?m.set(C,T):3===Z?m.add(T):m[C]=T}function c(m,C){return m===C?0!==m||1/m==1/C:m!=m&&C!=C}function s(m){return Pe&&m instanceof Map}function v(m){return Ce&&m instanceof Set}function p(m){return m.o||m.t}function l(m){if(Array.isArray(m))return Array.prototype.slice.call(m);var C=Oe(m);delete C[Ie];for(var T=Ne(C),Z=0;Z<T.length;Z++){var U=T[Z],L=C[U];!1===L.writable&&(L.writable=!0,L.configurable=!0),(L.get||L.set)&&(C[U]={configurable:!0,writable:!0,enumerable:L.enumerable,value:m[U]})}return Object.create(Object.getPrototypeOf(m),C)}function d(m,C){return void 0===C&&(C=!1),y(m)||r(m)||!t(m)||(o(m)>1&&(m.set=m.add=m.clear=m.delete=h),Object.freeze(m),C&&i(m,(function(m,C){return d(C,!0)}),!0)),m}function h(){n(2)}function y(m){return null==m||"object"!=typeof m||Object.isFrozen(m)}function b(m){var C=Me[m];return C||n(18,m),C}function _(){return Ee||n(0),Ee}function j(m,C){C&&(b("Patches"),m.u=[],m.s=[],m.v=C)}function g(m){O(m),m.p.forEach(S),m.p=null}function O(m){m===Ee&&(Ee=m.l)}function w(m){return Ee={p:[],l:Ee,h:m,m:!0,_:0}}function S(m){var C=m[Ie];0===C.i||1===C.i?C.j():C.g=!0}function P(m,C){C._=C.p.length;var T=C.p[0],Z=void 0!==m&&m!==T;return C.h.O||b("ES5").S(C,m,Z),Z?(T[Ie].P&&(g(C),n(4)),t(m)&&(m=M(C,m),C.l||x(C,m)),C.u&&b("Patches").M(T[Ie].t,m,C.u,C.s)):m=M(C,T,[]),g(C),C.u&&C.v(C.u,C.s),m!==we?m:void 0}function M(m,C,T){if(y(C))return C;var Z=C[Ie];if(!Z)return i(C,(function(U,L){return A(m,Z,C,U,L,T)}),!0),C;if(Z.A!==m)return C;if(!Z.P)return x(m,Z.t,!0),Z.t;if(!Z.I){Z.I=!0,Z.A._--;var U=4===Z.i||5===Z.i?Z.o=l(Z.k):Z.o,L=U,B=!1;3===Z.i&&(L=new Set(U),U.clear(),B=!0),i(L,(function(C,L){return A(m,Z,U,C,L,T,B)})),x(m,U,!1),T&&m.u&&b("Patches").N(Z,T,m.u,m.s)}return Z.o}function A(m,C,T,Z,U,L,B){if(U===T&&n(5),r(U)){var K=M(m,U,L&&C&&3!==C.i&&!u(C.R,Z)?L.concat(Z):void 0);if(f(T,Z,K),!r(K))return;m.m=!1}else B&&T.add(U);if(t(U)&&!y(U)){if(!m.h.D&&m._<1)return;M(m,U),C&&C.A.l||x(m,U)}}function x(m,C,T){void 0===T&&(T=!1),!m.l&&m.h.D&&m.m&&d(C,T)}function z(m,C){var T=m[Ie];return(T?p(T):m)[C]}function I(m,C){if(C in m)for(var T=Object.getPrototypeOf(m);T;){var Z=Object.getOwnPropertyDescriptor(T,C);if(Z)return Z;T=Object.getPrototypeOf(T)}}function k(m){m.P||(m.P=!0,m.l&&k(m.l))}function E(m){m.o||(m.o=l(m.t))}function N(m,C,T){var Z=s(C)?b("MapSet").F(C,T):v(C)?b("MapSet").T(C,T):m.O?function(m,C){var T=Array.isArray(m),Z={i:T?1:0,A:C?C.A:_(),P:!1,I:!1,R:{},l:C,t:m,k:null,o:null,j:null,C:!1},U=Z,L=Ze;T&&(U=[Z],L=Ue);var B=Proxy.revocable(U,L),K=B.revoke,G=B.proxy;return Z.k=G,Z.j=K,G}(C,T):b("ES5").J(C,T);return(T?T.A:_()).p.push(Z),Z}function R(m){return r(m)||n(22,m),function n(m){if(!t(m))return m;var C,T=m[Ie],Z=o(m);if(T){if(!T.P&&(T.i<4||!b("ES5").K(T)))return T.t;T.I=!0,C=D(m,Z),T.I=!1}else C=D(m,Z);return i(C,(function(m,Z){T&&a(T.t,m)===Z||f(C,m,n(Z))})),3===Z?new Set(C):C}(m)}function D(m,C){switch(C){case 2:return new Map(m);case 3:return Array.from(m)}return l(m)}var Se,Ee,je="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Pe="undefined"!=typeof Map,Ce="undefined"!=typeof Set,Te="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,we=je?Symbol.for("immer-nothing"):((Se={})["immer-nothing"]=!0,Se),De=je?Symbol.for("immer-draftable"):"__$immer_draftable",Ie=je?Symbol.for("immer-state"):"__$immer_state",ke=("undefined"!=typeof Symbol&&Symbol.iterator,{0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(m){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+m},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(m){return"Cannot apply patch, path doesn't resolve: "+m},16:'Sets cannot have "replace" patches.',17:function(m){return"Unsupported patch operation: "+m},18:function(m){return"The plugin for '"+m+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+m+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(m){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+m+"'"},22:function(m){return"'current' expects a draft, got: "+m},23:function(m){return"'original' expects a draft, got: "+m},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"}),Ae=""+Object.prototype.constructor,Ne="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(m){return Object.getOwnPropertyNames(m).concat(Object.getOwnPropertySymbols(m))}:Object.getOwnPropertyNames,Oe=Object.getOwnPropertyDescriptors||function(m){var C={};return Ne(m).forEach((function(T){C[T]=Object.getOwnPropertyDescriptor(m,T)})),C},Me={},Ze={get:function(m,C){if(C===Ie)return m;var T=p(m);if(!u(T,C))return function(m,C,T){var Z,U=I(C,T);return U?"value"in U?U.value:null===(Z=U.get)||void 0===Z?void 0:Z.call(m.k):void 0}(m,T,C);var Z=T[C];return m.I||!t(Z)?Z:Z===z(m.t,C)?(E(m),m.o[C]=N(m.A.h,Z,m)):Z},has:function(m,C){return C in p(m)},ownKeys:function(m){return Reflect.ownKeys(p(m))},set:function(m,C,T){var Z=I(p(m),C);if(null==Z?void 0:Z.set)return Z.set.call(m.k,T),!0;if(!m.P){var U=z(p(m),C),L=null==U?void 0:U[Ie];if(L&&L.t===T)return m.o[C]=T,m.R[C]=!1,!0;if(c(T,U)&&(void 0!==T||u(m.t,C)))return!0;E(m),k(m)}return m.o[C]===T&&(void 0!==T||C in m.o)||Number.isNaN(T)&&Number.isNaN(m.o[C])||(m.o[C]=T,m.R[C]=!0),!0},deleteProperty:function(m,C){return void 0!==z(m.t,C)||C in m.t?(m.R[C]=!1,E(m),k(m)):delete m.R[C],m.o&&delete m.o[C],!0},getOwnPropertyDescriptor:function(m,C){var T=p(m),Z=Reflect.getOwnPropertyDescriptor(T,C);return Z?{writable:!0,configurable:1!==m.i||"length"!==C,enumerable:Z.enumerable,value:T[C]}:Z},defineProperty:function(){n(11)},getPrototypeOf:function(m){return Object.getPrototypeOf(m.t)},setPrototypeOf:function(){n(12)}},Ue={};i(Ze,(function(m,C){Ue[m]=function(){return arguments[0]=arguments[0][0],C.apply(this,arguments)}})),Ue.deleteProperty=function(m,C){return isNaN(parseInt(C))&&n(13),Ue.set.call(this,m,C,void 0)},Ue.set=function(m,C,T){return"length"!==C&&isNaN(parseInt(C))&&n(14),Ze.set.call(this,m[0],C,T,m[0])};var Le=function(){function e(m){var C=this;this.O=Te,this.D=!0,this.produce=function(m,T,Z){if("function"==typeof m&&"function"!=typeof T){var U=T;T=m;var L=C;return function(m){var C=this;void 0===m&&(m=U);for(var Z=arguments.length,B=Array(Z>1?Z-1:0),K=1;K<Z;K++)B[K-1]=arguments[K];return L.produce(m,(function(m){var Z;return(Z=T).call.apply(Z,[C,m].concat(B))}))}}var B;if("function"!=typeof T&&n(6),void 0!==Z&&"function"!=typeof Z&&n(7),t(m)){var K=w(C),G=N(C,m,void 0),F=!0;try{B=T(G),F=!1}finally{F?g(K):O(K)}return"undefined"!=typeof Promise&&B instanceof Promise?B.then((function(m){return j(K,Z),P(m,K)}),(function(m){throw g(K),m})):(j(K,Z),P(B,K))}if(!m||"object"!=typeof m){if(void 0===(B=T(m))&&(B=m),B===we&&(B=void 0),C.D&&d(B,!0),Z){var H=[],V=[];b("Patches").M(m,B,H,V),Z(H,V)}return B}n(21,m)},this.produceWithPatches=function(m,T){if("function"==typeof m)return function(T){for(var Z=arguments.length,U=Array(Z>1?Z-1:0),L=1;L<Z;L++)U[L-1]=arguments[L];return C.produceWithPatches(T,(function(C){return m.apply(void 0,[C].concat(U))}))};var Z,U,L=C.produce(m,T,(function(m,C){Z=m,U=C}));return"undefined"!=typeof Promise&&L instanceof Promise?L.then((function(m){return[m,Z,U]})):[L,Z,U]},"boolean"==typeof(null==m?void 0:m.useProxies)&&this.setUseProxies(m.useProxies),"boolean"==typeof(null==m?void 0:m.autoFreeze)&&this.setAutoFreeze(m.autoFreeze)}var m=e.prototype;return m.createDraft=function(m){t(m)||n(8),r(m)&&(m=R(m));var C=w(this),T=N(this,m,void 0);return T[Ie].C=!0,O(C),T},m.finishDraft=function(m,C){var T=m&&m[Ie];T&&T.C||n(9),T.I&&n(10);var Z=T.A;return j(Z,C),P(void 0,Z)},m.setAutoFreeze=function(m){this.D=m},m.setUseProxies=function(m){m&&!Te&&n(20),this.O=m},m.applyPatches=function(m,C){var T;for(T=C.length-1;T>=0;T--){var Z=C[T];if(0===Z.path.length&&"replace"===Z.op){m=Z.value;break}}T>-1&&(C=C.slice(T+1));var U=b("Patches").$;return r(m)?U(m,C):this.produce(m,(function(m){return U(m,C)}))},e}(),Be=new Le,Ke=Be.produce,Re=(Be.produceWithPatches.bind(Be),Be.setAutoFreeze.bind(Be),Be.setUseProxies.bind(Be),Be.applyPatches.bind(Be),Be.createDraft.bind(Be),Be.finishDraft.bind(Be),Ke),Ge=function(m){return m.UPDATE_MANAGE_STATUS="UPDATE_MANAGE_STATUS",m.UPDATE_MULTIPLE_SELECTION_STATUS="UPDATE_MULTIPLE_SELECTION_STATUS",m.UPDATE_CURRENT_CHECKED_PURCHASERID="UPDATE_CURRENT_CHECKED_PURCHASERID",m.UPDATE_COLOR_STORE="UPDATE_COLOR_STORE",m.UPDATE_SELECTED_AMOUNT="UPDATE_SELECTED_AMOUNT",m.UPDATE_CHANGED_CHECKBOX="UPDATE_CHANGED_CHECKBOX",m}({}),ze=Re((function(m,C){var T=C.type,Z=C.data;switch(T){case Ge.UPDATE_MANAGE_STATUS:m.isManageStatus=Z;break;case Ge.UPDATE_MULTIPLE_SELECTION_STATUS:m.isMultipleSelection=Z;break;case Ge.UPDATE_CURRENT_CHECKED_PURCHASERID:m.currentCheckedPurchaserId=Z;break;case Ge.UPDATE_COLOR_STORE:m.colorStore=Z;break;case Ge.UPDATE_SELECTED_AMOUNT:m.selectedAmount=Z;break;case Ge.UPDATE_CHANGED_CHECKBOX:m.colorStore[Z.purchaserId]?m.colorStore[Z.purchaserId]=Re(m.colorStore[Z.purchaserId],(function(m){m.purchaserId=Z.purchaserId,m.goodsKind=(0,U.Z)((0,U.Z)({},m.goodsKind),Z.goodsKind),m.multipleSelection=Z.multipleSelection?Z.multipleSelection:null==m?void 0:m.multipleSelection})):m.colorStore[Z.purchaserId]={purchaserId:Z.purchaserId,goodsKind:Z.goodsKind,multipleSelection:Z.multipleSelection};break;default:!function throwError(){throw new Error("没有这个action.type")}()}})),Fe=W().createContext(null),He=W().createContext(null);function useShoppingState(){var m=(0,V.useContext)(Fe);if(!m)throw new Error("没有获取到shopping context");return m}function useShoppingDispatch(){var m=(0,V.useContext)(He);if(!m)throw new Error("没有获取到shopping dispatch");return m}var Ve={common_safe_area_y:"index-module__common_safe_area_y___hMeQP","flex-col":"index-module__flex-col___u4mqJ","flex-row":"index-module__flex-row___QF4Xz","justify-between":"index-module__justify-between___SVnXc","justify-center":"index-module__justify-center___WAqpp","items-center":"index-module__items-center___TeRak","flex-item":"index-module__flex-item___JP4fE","full-100":"index-module__full-100___sMWPr","color-blue":"index-module__color-blue___M3nPu","color-yellow":"index-module__color-yellow___wQhTc","color-green":"index-module__color-green___ymSO3","color-grey":"index-module__color-grey___Rpf81","color-white":"index-module__color-white___U5GdE","s-w":"index-module__s-w___lIaPQ","s-e":"index-module__s-e___Wsj1P",filter:"index-module__filter___ah9RB",layout:"index-module__layout___xCsni",checkbox:"index-module__checkbox___h99C7","checkbox--text":"index-module__checkbox--text___f_Yes",selected:"index-module__selected___jo7LR",line:"index-module__line___kat2C",topItem:"index-module__topItem___yYKWx",topTitle:"index-module__topTitle___FdpQH",summary:"index-module__summary___b0i6I",detailBox:"index-module__detailBox___Ug3IB",orderTitle:"index-module__orderTitle___FfbyX",orderType:"index-module__orderType___hlmst",orderTypeDetail:"index-module__orderTypeDetail___aDmtP",orderColor:"index-module__orderColor___rxtLi",bottomBox:"index-module__bottomBox____9Lf7",drawerButton:"index-module__drawerButton___l8Rgq",drawerOpen:"index-module__drawerOpen___xkch1",drawerClose:"index-module__drawerClose___XfbvG",saleModeButton:"index-module__saleModeButton___Y9vCc","saleModeButton--text":"index-module__saleModeButton--text___mrVBc","saleModeButton--active":"index-module__saleModeButton--active___mrbjn",noList:"index-module__noList___FELw0"},We=T(8260),$e=T(9579),Xe=T(2128),Qe=T(6028),qe=T(1115),Je=T(1263),Ye=function(m){return m[m.bulk_color_list=0]="bulk_color_list",m[m.length_cut_color_list=1]="length_cut_color_list",m[m.weight_cut_color_list=2]="weight_cut_color_list",m}({}),et=[Ye.bulk_color_list,Ye.length_cut_color_list,Ye.weight_cut_color_list],tt=function SaleModeButton(m){var C=m.onClick,T=m.children,Z=m.isActive,U=void 0!==Z&&Z,L=m.customStyle;return(0,ge.jsx)(G.G7,{className:X()(Ve.saleModeButton,U&&Ve["saleModeButton--active"]),style:L,onClick:function handleClick(){null==C||C()},children:(0,ge.jsx)(G.G7,{className:X()(Ve["saleModeButton--text"]),children:T})})},nt=function DrawerButton(m){var C=m.isOpen;return(0,ge.jsx)(G.G7,{className:Ve.drawerButton,children:C?(0,ge.jsx)(Qe.Z,{name:"icon-shouqi",size:52}):(0,ge.jsx)(Qe.Z,{name:"icon-zhankai",size:52})})},rt=(0,V.memo)(nt),ot=function ColorKindItemContainer(m){var C=m.id,T=m.item,Z=m.purchaser_id,U=m.checked;return(0,ge.jsx)(be,{checked:U,purchaserId:Z,itemData:T},C)},it=(0,V.memo)(ot),lt=function GoodsList(m){var C,T=m.itemData,Z=m.selected,U=m.multipleSelection;return console.log("rerender component GoodsList",m,null===(C=m.itemData)||void 0===C?void 0:C.purchaser_name),(0,ge.jsx)(ge.Fragment,{children:0!==(null==T?void 0:T[Ye[Z]].length)?null==T?void 0:T[Ye[Z]].map((function(m){return console.log("item===>",m,null==U?void 0:U.hasOwnProperty(m.id)),(0,ge.jsx)(it,{checked:(null==U?void 0:U.hasOwnProperty(m.id))||!1,id:m.id,purchaser_id:T.purchaser_id,item:m},m.id)})):(0,ge.jsx)(G.G7,{className:Ve.noList,children:"暂无数据"})})},ct=(0,V.memo)(lt),ut=function withStateSlice(m,C){var T=(0,V.memo)(m),Z=function Wrapper(m,C){var Z=useShoppingState(),L=(0,V.useMemo)((function(){return{currentCheckedPurchaserId:Z.currentCheckedPurchaserId,isMultipleSelection:Z.isMultipleSelection}}),[Z.currentCheckedPurchaserId,Z.isMultipleSelection]);return(0,ge.jsx)(T,(0,U.Z)({ref:C,state:L},m))};return(0,V.memo)((0,V.forwardRef)(Z))}((function ShoppingCartItem(m){var C,T,Z=m.state;console.log("rerender component ShoppingCartItem",m,null===(C=m.itemData)||void 0===C?void 0:C.purchaser_name);var F=(0,V.useRef)(m.itemData);F.current=m.itemData;var W=(0,xe.BL)({value:F.current,defaultValue:m.itemData}),$=(0,K.Z)(W,2),Q=$[0],q=$[1],J=(0,V.useState)([]),Y=(0,K.Z)(J,2),ee=Y[0],te=Y[1];console.log("rerender multipleSelection",ee,null===(T=m.itemData)||void 0===T?void 0:T.purchaser_name);var ne=Z,ie=ne.currentCheckedPurchaserId,le=ne.isMultipleSelection,ue=useShoppingDispatch(),ae=(0,V.useState)(!1),se=(0,K.Z)(ae,2),de=se[0],_e=se[1],pe=(0,V.useState)(0),he=(0,K.Z)(pe,2),ye=he[0],be=he[1];(0,V.useEffect)((function(){ie===(null==Q?void 0:Q.purchaser_id)&&(console.log("isMultipleSelection",le,ie,null==Q?void 0:Q.purchaser_id),le&&te(Object.fromEntries(null==Q?void 0:Q[Ye[ye]].map((function(m){return[null==m?void 0:m.id,{id:null==m?void 0:m.id,estimate_amount:m.estimate_amount,product_code:m.product_code,product_color_code:m.product_color_code,sale_mode:m.sale_mode,count:ye===me.p.Bulk?m.roll:Number((0,fe.N6)(m.length))}]})))))}),[le,Q,ye,ie]);var Se=function cleanMultiSelection(){ie===(null==Q?void 0:Q.purchaser_id)&&te({})},Ee=function onSelectOrderType(m){ye!==m&&Se(),be(m),ue({type:Ge.UPDATE_SELECTED_AMOUNT,data:0}),ue({type:Ge.UPDATE_MULTIPLE_SELECTION_STATUS,data:!1})},je=function handleClickLayout(){var C,T;ie!==(null===(C=m.itemData)||void 0===C?void 0:C.purchaser_id)&&(F.current=m.itemData,q(m.itemData),ue({type:Ge.UPDATE_SELECTED_AMOUNT,data:0}),ue({type:Ge.UPDATE_CURRENT_CHECKED_PURCHASERID,data:null===(T=m.itemData)||void 0===T?void 0:T.purchaser_id}),ue({type:Ge.UPDATE_MULTIPLE_SELECTION_STATUS,data:Object.values(ee).length===(null==Q?void 0:Q[Ye[ye]].length)}))},Pe=(0,V.useMemo)((function(){var m;return console.log("materialChecked",ee),!ee||(0,qe.Qr)(ee)?0:new Set(null===(m=Object.values(ee))||void 0===m?void 0:m.reduce((function(m,C){return C.sale_mode===ye?[].concat((0,oe.Z)(m),[C.product_code]):m}),[])).size}),[ee,ie,ye]),Ce=(0,V.useMemo)((function(){return console.log("colorChecked item",ee),!ee||(0,qe.Qr)(ee)?0:new Set(Object.values(ee).reduce((function(m,C){return C.sale_mode===ye?[].concat((0,oe.Z)(m),[C.product_color_code]):m}),[])).size}),[ee,ie,ye]),Te=(0,V.useMemo)((function(){return console.log("lengthOrRollChecked item",ee,ie),!ee||(0,qe.Qr)(ee)?0:Object.values(ee).reduce((function(m,C){return m+C.count}),0)||0}),[ee,ie,ye]),we=(0,Je.kM)().fetchData,De=function updatePurchaserMultipleSelection(m,C,T,Z){if((null==Q?void 0:Q.purchaser_id)===m)if(console.log("updatePurchaserMultipleSelection",m),"add"===T){var L=(0,U.Z)((0,U.Z)({},ee),{},(0,re.Z)({},Z,C));console.log("nextMultipleSelection",L),te(L),(null==Q?void 0:Q[Ye[ye]].length)===Object.keys(L).length&&ue({type:Ge.UPDATE_MULTIPLE_SELECTION_STATUS,data:!0})}else if("delete"===T){var B=(0,U.Z)({},ee);null==B||delete B[Z],te(B),le&&ue({type:Ge.UPDATE_MULTIPLE_SELECTION_STATUS,data:!1})}},Ie=function handleOtherHighLight(m,C){if(m===(null==Q?void 0:Q.purchaser_id)){if(0!==(null==C?void 0:C[Ye[ye]].length))return;for(var T=0;T<et.length;T++)if(0!==(null==C?void 0:C[Ye[T]].length))return void Ee(T)}};(0,V.useEffect)((function(){return ce.on("handleOtherHighLight",Ie),function(){ce.off("handleOtherHighLight",Ie)}}),[Ie]),(0,V.useEffect)((function(){return ce.on("updatePurchaserMultipleSelection",De),function(){ce.off("updatePurchaserMultipleSelection",De)}}),[De]);var ke=function(){var m=(0,B.Z)((0,L.Z)().mark((function _callee(m){var C,T,Z;return(0,L.Z)().wrap((function _callee$(U){for(;;)switch(U.prev=U.next){case 0:if((null==Q?void 0:Q.purchaser_id)===m){U.next=2;break}return U.abrupt("return");case 2:return console.log("request new data start run"),U.next=5,we({purchaser_id:m});case 5:if(C=U.sent,console.log("res===>",C),!C.success){U.next=16;break}if(C.data.list.length){U.next=10;break}return U.abrupt("return",qe.Z9.error("修改数量失败"));case 10:Z=Object.fromEntries(null===(T=C.data.list[0])||void 0===T?void 0:T[Ye[ye]].map((function(m){return[null==m?void 0:m.id,{id:null==m?void 0:m.id,estimate_amount:m.estimate_amount,product_code:m.product_code,product_color_code:m.product_color_code,sale_mode:m.sale_mode,count:ye===me.p.Bulk?m.roll:Number((0,fe.N6)(m.length))}]}))),te((function(m){return Object.fromEntries(Object.keys(m).map((function(m){return[m,{id:Number(m),estimate_amount:Z[m].estimate_amount,product_code:Z[m].product_code,product_color_code:Z[m].product_color_code,sale_mode:Z[m].sale_mode,count:Z[m].count}]})))})),F.current=C.data.list[0],q((function(){return C.data.list[0]})),U.next=17;break;case 16:qe.Z9.error("请求失败");case 17:case"end":return U.stop()}}),_callee)})));return function fetchSpecificPurchaser(C){return m.apply(this,arguments)}}(),Ae=(0,Je.iN)().fetchData,Ne=function(){var C=(0,B.Z)((0,L.Z)().mark((function _callee3(C){var T;return(0,L.Z)().wrap((function _callee3$(Z){for(;;)switch(Z.prev=Z.next){case 0:if(console.log("handleDelete",null==Q?void 0:Q.purchaser_id,C),C===(null==Q?void 0:Q.purchaser_id)){Z.next=3;break}return Z.abrupt("return");case 3:if(console.log("multipleSelection",ee),0!==(T=Object.values(ee)).length){Z.next=7;break}return Z.abrupt("return",qe.Z9.error("请选择商品"));case 7:console.log("checked==>",T),H().showModal({title:"要删除这些商品吗?",success:function success(C){return(0,B.Z)((0,L.Z)().mark((function _callee2(){var Z,U;return(0,L.Z)().wrap((function _callee2$(L){for(;;)switch(L.prev=L.next){case 0:if(!C.confirm){L.next=7;break}return qe.Z9.showLoading("删除中"),Z=T.map((function(m){return m.id})),L.next=5,Ae({ids:Z.join(",")});case 5:(U=L.sent).success?(qe.Z9.hideLoading(),qe.Z9.success("删除成功"),Se(),ue({type:Ge.UPDATE_MULTIPLE_SELECTION_STATUS,data:!1}),null==m||m.onDeleteItem()):(qe.Z9.hideLoading(),qe.Z9.none(U.msg));case 7:case"end":return L.stop()}}),_callee2)})))()}});case 9:case"end":return Z.stop()}}),_callee3)})));return function handleDelete(m){return C.apply(this,arguments)}}(),Oe=function handleSettleAccount(m){if(console.log("handleSettleAccount",null==Q?void 0:Q.purchaser_id,m),m===(null==Q?void 0:Q.purchaser_id)){if(!ee)return qe.Z9.error("请先选择客户");var C=Object.values(ee).reduce((function(m,C){return[].concat((0,oe.Z)(m),[C.id])}),[]);if(0===C.length)return qe.Z9.error("请先选择商品");(0,qe.jD)("/pages/submitOrder/index",{purchaser_id:ie,sale_mode:ye,shopping_cart_product_color_list:JSON.stringify(C),purchaser_name:null==Q?void 0:Q.purchaser_name,isBuyNew:!1})}};return(0,V.useEffect)((function(){return ce.on("FetchSpecificPurchaser",ke),ce.on("DeleteSpecificItem",Ne),ce.on("SettleAccount",Oe),ce.on("CleanMultiSelection",Se),function(){ce.off("FetchSpecificPurchaser",ke),ce.off("DeleteSpecificItem",Ne),ce.off("SettleAccount",Oe),ce.off("CleanMultiSelection",Se)}}),[ke,Ne,Oe]),(0,V.useEffect)((function(){if((null==Q?void 0:Q.purchaser_id)===ie){var m=Object.values(ee);if(console.log("shoppingCartItem multipleSelection change",ee,null==Q?void 0:Q.purchaser_name),m.length>0){var C=m.reduce((function(m,C){return m+Number((0,fe.yb)(C.estimate_amount))}),0);ue({type:Ge.UPDATE_SELECTED_AMOUNT,data:C})}else ue({type:Ge.UPDATE_SELECTED_AMOUNT,data:0})}}),[ee]),(0,ge.jsxs)(We.Z,{circle:!0,customClassName:X()(Ve.layout,(null==Q?void 0:Q.purchaser_id)===ie?Ve.selected:""),customStyle:{paddingBottom:de?0:"24rpx"},onClick:je,children:[(0,ge.jsxs)(G.G7,{className:X()(Ve.checkbox,"flex-row","justify-between"),onClick:function handleOpenDetail(){_e((function(m){return!m})),je()},children:[(0,ge.jsxs)(G.G7,{className:Ve.topItem,children:[(0,ge.jsxs)(G.G7,{className:"flex-row items-center",children:[(0,ge.jsx)(G.G7,{className:Ve.topTitle,children:null==Q?void 0:Q.purchaser_name}),(null==Q?void 0:Q.sale_user_name)&&(0,ge.jsx)($e.Z,{type:"info",size:"normal",circle:!0,customStyle:{backgroundColor:"#f0f0f0",borderColor:"transparent"},plain:!0,children:null==Q?void 0:Q.sale_user_name})]}),(0,ge.jsx)(G.G7,{className:Ve.summary,children:(0,ge.jsxs)(G.xv,{children:["已选 ",Pe," 种面料,",Ce," 个颜色,共"," ",ye===me.p.Bulk?"".concat(Te," 条"):"".concat(Te.toLocaleString()," 米")]})})]}),(0,ge.jsx)(rt,{isOpen:de})]}),de&&(0,ge.jsx)(ge.Fragment,{children:(0,ge.jsxs)(G.G7,{className:X()(Ve.detailBox,de?Ve.drawerOpen:Ve.drawerClose),children:[(0,ge.jsx)(G.G7,{className:Ve.orderType,children:(0,ge.jsxs)(G.G7,{className:Ve.orderTypeDetail,children:[(0,ge.jsx)(tt,{customStyle:{padding:"0 50rpx",height:"60rpx"},isActive:ye===me.p.Bulk,onClick:function onClick(){return Ee(me.p.Bulk)},children:"大货"}),(0,ge.jsx)(tt,{customStyle:{padding:"0 50rpx",height:"60rpx"},isActive:ye===me.p.Plate,onClick:function onClick(){return Ee(me.p.Plate)},children:"剪板"}),(0,ge.jsx)(tt,{customStyle:{padding:"0 50rpx",height:"60rpx"},isActive:ye===me.p.BulkCut,onClick:function onClick(){return Ee(me.p.BulkCut)},children:"散剪"})]})}),(0,ge.jsxs)(G.G7,{className:Ve.orderColor,children:[(0,ge.jsx)(Xe.Z,{customClassName:Ve.line}),(0,ge.jsxs)(G.G7,{className:X()(Ve.orderTitle,"justify-between"),children:[(0,ge.jsx)(G.xv,{children:"布料颜色"}),(0,ge.jsxs)($e.Z,{type:"danger",size:"normal",circle:!0,plain:!0,children:[ve.F[ye].title,"单位:",ve.F[ye].unit]})]})]}),(0,ge.jsx)(G.G7,{className:Ve.orderContainer,children:(0,ge.jsx)(ct,{multipleSelection:ee,itemData:Q,selected:ye})})]})})]})})),at=ut,st={common_safe_area_y:"index-module__common_safe_area_y___ywkBM","flex-col":"index-module__flex-col___de8wP","flex-row":"index-module__flex-row___gDspD","justify-between":"index-module__justify-between___VoVh6","justify-center":"index-module__justify-center___gVzDU","items-center":"index-module__items-center___ozCp3","flex-item":"index-module__flex-item___gVEzn","full-100":"index-module__full-100___jvGKu","color-blue":"index-module__color-blue___c4cFd","color-yellow":"index-module__color-yellow___fKrs3","color-green":"index-module__color-green___yIx6k","color-grey":"index-module__color-grey___oGnEl","color-white":"index-module__color-white___bN0GE","s-w":"index-module__s-w___WGA8M","s-e":"index-module__s-e___Tk6q7",filter:"index-module__filter____OLRp",bottomBar:"index-module__bottomBar___s1C3T",bottomLeft:"index-module__bottomLeft___CXaSe",moneyText:"index-module__moneyText___HI_B_",moneyNumber:"index-module__moneyNumber___adzn0",unit:"index-module__unit___Yo7zI",money:"index-module__money___sgJ8F"},dt=T(9742),_t=function BottomSettleBar(m){var C=m.onSettleAccount,T=m.amount,Z=void 0===T?0:T;return(0,ge.jsxs)(G.G7,{className:st.bottomBar,children:[(0,ge.jsxs)(G.G7,{className:st.bottomLeft,children:[(0,ge.jsx)(G.xv,{className:st.moneyText,children:"预估金额:"}),(0,ge.jsxs)(G.xv,{className:st.moneyNumber,children:[(0,ge.jsx)(G.xv,{className:st.unit,children:"¥"}),(0,ge.jsx)(G.xv,{className:st.money,children:(0,fe.yb)(Z,1,!0)})]})]}),(0,ge.jsx)(G.G7,{className:st.bottomRight,children:(0,ge.jsx)(dt.Z,{type:"primary",round:!0,size:"normal",onClick:function handleSettle(){C&&C()},customStyles:{padding:"0 80rpx"},children:(0,ge.jsx)(G.xv,{style:{fontSize:"32rpx"},children:"结算"})})})]})},ft="index-module__bottomBar___hWO3j",mt="index-module__bottomLeft___UsLb7",pt="index-module__bottomRight___NAKOE",ht=function BottomEditBar(m){var C=m.onDelete,T=m.onSelectCheckbox,Z=m.disabled,U=void 0!==Z&&Z,L=m.isSelectAll,B=void 0!==L&&L,F=useShoppingDispatch();console.log("isSelectAll==>",B);var H=(0,xe.BL)({value:B,defaultValue:!1}),V=(0,K.Z)(H,2),W=V[0];V[1];return(0,ge.jsxs)(G.G7,{className:ft,children:[(0,ge.jsx)(G.G7,{className:mt,children:(0,ge.jsx)(se.Z,{status:W,disabled:U,round:!0,size:"small",onSelect:function selectCallBack(){T&&T(!0),F({type:Ge.UPDATE_MULTIPLE_SELECTION_STATUS,data:!0})},onClose:function closeCallBack(){F({type:Ge.UPDATE_MULTIPLE_SELECTION_STATUS,data:!1}),T&&T(!1)},customStyles:{color:"$color: #000000, $alpha: 0.6"},children:"全选"})}),(0,ge.jsx)(G.G7,{className:pt,children:(0,ge.jsx)(dt.Z,{round:!0,type:"danger",size:"normal",onClick:function handleDelete(){C&&C()},customStyles:{backgroundColor:"#F44761",padding:"0 80rpx"},children:(0,ge.jsx)(G.xv,{style:{fontSize:"32rpx"},children:"删除"})})})]})},xt=function ShoppingProvider(m){var C=m.children,T=m.initialValues,Z=(0,V.useMemo)((function(){return new ue}),[]),U=(0,V.useReducer)(ze,{colorStore:T||{},currentCheckedPurchaserId:-1,isManageStatus:!1,isMultipleSelection:!1,selectedAmount:0,Observer:Z}),L=(0,K.Z)(U,2),B=L[0],G=L[1];return(0,ge.jsx)(Fe.Provider,{value:B,children:(0,ge.jsx)(He.Provider,{value:G,children:C})})},vt=T(9335),gt=T(3818),yt=T(4489),bt=T(8932),St=function ShoppingCartContainer(){var m,C,T=(0,V.useRef)(!0);console.log("rerender component ShoppingCartContainer");var Z=useShoppingState(),H=Z.isMultipleSelection,W=Z.isManageStatus,$=Z.selectedAmount,re=Z.currentCheckedPurchaserId;console.log("rerender selectedAmount",$);var oe=useShoppingDispatch(),ie=(0,V.useRef)("auto"),le=(0,Je.kM)(),ue=le.fetchData,ae=le.state,se=(0,V.useState)({page:1,size:10}),de=(0,K.Z)(se,2),fe=de[0],me=de[1],pe=(0,V.useRef)({size:fe.size,page:fe.page}),he=function(){var m=(0,B.Z)((0,L.Z)().mark((function _callee(){return(0,L.Z)().wrap((function _callee$(m){for(;;)switch(m.prev=m.next){case 0:return m.next=2,ue((0,_e.mB)(fe));case 2:m.sent.success||(qe.Z9.error("请求失败"),Ie(!1)),Ie(!1);case 5:case"end":return m.stop()}}),_callee)})));return function getData(){return m.apply(this,arguments)}}();(0,F.useDidShow)((0,B.Z)((0,L.Z)().mark((function _callee2(){return(0,L.Z)().wrap((function _callee2$(m){for(;;)switch(m.prev=m.next){case 0:T.current||(console.log("重新刷新"),he());case 1:case"end":return m.stop()}}),_callee2)})))),(0,V.useEffect)((function(){console.log("useEffect fetchData",(0,_e.mB)(fe)),T.current||he()}),[fe]);var ve=(0,V.useCallback)((0,_e.Ds)((function(m){console.log("getSearchData===>",m),me({short_name_or_phone:m,size:10,page:1})}),300),[]),ye=(0,V.useState)({list:[],total:0}),be=(0,K.Z)(ye,2),Se=be[0],Ee=be[1],je=(0,V.useMemo)((function(){console.log("shoppingCartData==>",Se,ae);var m=(0,_e.rA)({list:Se.list,total:Se.total,status:ae.loading});return console.log("status==>",m),m}),[Se,ae]);(0,V.useLayoutEffect)((function(){(0,B.Z)((0,L.Z)().mark((function _callee3(){return(0,L.Z)().wrap((function _callee3$(m){for(;;)switch(m.prev=m.next){case 0:return console.log("useLayoutEffect"),m.next=3,ue((0,_e.mB)(fe));case 3:T.current=!1;case 4:case"end":return m.stop()}}),_callee3)})))()}),[]),(0,V.useEffect)((function(){ae.success&&(console.log("fetch success",ae),Ee({list:ae.data.list,total:ae.data.total}))}),[ae]);var Pe=(0,_e.Ds)((function(){ce.trigger("SettleAccount",re)}),400),Ce=(0,V.useCallback)((0,B.Z)((0,L.Z)().mark((function _callee4(){var m;return(0,L.Z)().wrap((function _callee4$(C){for(;;)switch(C.prev=C.next){case 0:return C.next=2,ue(fe);case 2:m=C.sent,console.log("onDeleteItem"),ce.trigger("handleOtherHighLight",re,m.data.list.find((function(m){return m.purchaser_id===re})));case 5:case"end":return C.stop()}}),_callee4)}))),[]),Te=(0,V.useState)(!1),we=(0,K.Z)(Te,2),De=we[0],Ie=we[1],ke=function(){var m=(0,B.Z)((0,L.Z)().mark((function _callee5(){return(0,L.Z)().wrap((function _callee5$(m){for(;;)switch(m.prev=m.next){case 0:pe.current.page=1,Ie(!0),me((function(m){return(0,U.Z)((0,U.Z)({},m),{},{size:10})}));case 3:case"end":return m.stop()}}),_callee5)})));return function handleRefresh(){return m.apply(this,arguments)}}();(0,xe.F5)(bt.R2.SHOPPING);var Ae=(0,V.useCallback)((function(){if(Se.list.length<Se.total){pe.current.page++;var m=pe.current.size*pe.current.page;me((function(C){return(0,U.Z)((0,U.Z)({},C),{},{size:m})}))}}),[Se]);return(0,ge.jsxs)(G.G7,{className:X()("flex-col",Q),id:"shoppingContainer",children:[(0,ge.jsx)(G.G7,{className:q,id:"topBar",children:(0,ge.jsx)(yt.Z,{placeholder:"请输入客户名称",showBtn:!1,changeOnSearch:ve,children:(0,ge.jsx)(G.G7,{className:te,onClick:function onStartToManage(){oe({type:Ge.UPDATE_MANAGE_STATUS,data:!W})},children:W?(0,ge.jsx)(gt.Z,{svg:!0,iconName:"icon-guanlidingdan",text:"取消",color:"#4581ff",customClass:ne}):(0,ge.jsx)(gt.Z,{svg:!0,iconName:"icon-guanlidingdan",text:"管理"})})})}),(0,ge.jsxs)(G.G7,{className:X()("flex-item","flex-col",J),children:[(0,ge.jsx)(G.G7,{id:"shoppingListContainer",className:X()(Y,"flex-item"),style:{height:ie.current},children:(0,ge.jsx)(vt.Z,{selfonScrollToLower:Ae,safeAreaInsetBottom:!1,statusMore:je,refresherEnabled:!0,selfOnRefresherRefresh:ke,refresherTriggered:De,children:!(null==Se||null===(m=Se.list)||void 0===m||!m.length)&&(null==Se||null===(C=Se.list)||void 0===C?void 0:C.map((function(m,C){return(0,ge.jsx)(at,{itemData:m,onDeleteItem:Ce},C)})))})}),(0,ge.jsx)(G.G7,{className:ee,children:W?(0,ge.jsx)(ht,{disabled:re<0,isSelectAll:H,onDelete:function handleDelete(){console.log("handleDelete"),ce.trigger("DeleteSpecificItem",re)},onSelectCheckbox:function onSelectCheckbox(m){return function handleSelectAllCheckbox(m){if(!re)return qe.Z9.error("请先选择客户");m?oe({type:Ge.UPDATE_MULTIPLE_SELECTION_STATUS,data:m}):ce.trigger("CleanMultiSelection",re)}(m)}}):(0,ge.jsx)(_t,{onSettleAccount:Pe,amount:$})})]})]})},Et=function Shopping(){return(0,ge.jsx)(xt,{children:(0,ge.jsx)(St,{})})},jt=(0,V.memo)(Et);Page((0,Z.createPageConfig)(jt,"pages/shopping/index",{root:{cn:[]}},{navigationBarTitleText:"购物页面"}||{}))}},function(m){m.O(0,[2107,1216,8592],(function(){return C=8698,m(m.s=C);var C}));m.O()}]); |