/*! For license information please see index.js.LICENSE.txt */ "use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["pages/shopCar/index"],{"./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/shopCar/index.tsx":function(e,t,n){var o=n("./src/pages/shopCar/components/main/index.tsx"),s=n("./src/components/loginAuthenticationMask/index.tsx"),c=n("./src/context/ContextShop/index.tsx"),a=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=function(){return(0,a.jsxs)(c.default,{children:[(0,a.jsx)(s.default,{}),(0,a.jsx)(o.default,{})]})}},"./src/context/ContextShop/index.tsx":function(e,t,n){n.d(t,{useCurrenShop:function(){return d}});var o=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),s=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),c=n("./node_modules/react/cjs/react.production.min.js"),a=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");var l=function createCtx(){var e=c.createContext(void 0);return[function useCtx(){var t=(0,c.useContext)(e);if(void 0===t)throw new Error("useCtx must be inside a Provider with a value");return t},e.Provider]}(),r=(0,s.default)(l,2),d=r[0],u=r[1];t.default=function(e){var t=(0,c.useReducer)((function reducer(e,t){switch(t.type){case"setInitData":return i(e,t);case"updateProduct":return _(e,t);case"setRecommendId":return(0,o.default)((0,o.default)({},e),{},{recommendId:t.data.recommendId});case"setDelCommendId":return(0,o.default)((0,o.default)({},e),{},{delCommendId:t.data.delCommendId});default:return e}}),{list:[],statistics:{product_number:0,color_number:0,roll_number:0,length_number:0,price_number:0},recommendId:0,delCommendId:0}),n=(0,s.default)(t,2),l=n[0],r=n[1];return(0,a.jsx)(u,{value:{state:l,dispatch:r},children:e.children})};var i=function onInitData(e,t){var n,s=t.data;return null===(n=s.list)||void 0===n||n.map((function(e,t){var n;e.index_str=t.toString(),e.checked=!1,null===(n=e.color_list)||void 0===n||n.map((function(e,n){e.index_str="".concat(t,",").concat(n),e.checked=!1}))})),(0,o.default)((0,o.default)({},e),{},{list:s.list,sale_mode:s.sale_mode,recommendId:0,statistics:{product_number:0,color_number:0,roll_number:0,length_number:0,price_number:0},delCommendId:0})},_=function onUpdateData(e,t){var n,s=t.data,c={product_number:0,color_number:0,roll_number:0,length_number:0,price_number:0};return null===(n=s.list)||void 0===n||n.map((function(e,t){var n;null===(n=e.color_list)||void 0===n||n.map((function(e){e.checked&&(c.color_number+=1,c.price_number+=e.estimate_amount,c.roll_number+=e.roll,c.length_number+=e.length)})),e.checked&&(c.product_number+=1)})),console.log("data:::",s.list),(0,o.default)((0,o.default)({},e),{},{list:s.list,statistics:c})}},"./src/pages/shopCar/components/RecommendOpen/index.tsx":function(e,t,n){var o=n("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),s=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),c=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),a=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),l=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),r=n("./node_modules/react/cjs/react.production.min.js"),d=n("./node_modules/big.js/big.mjs"),u=n("./src/pages/shopCar/components/recommendProductItem/index.tsx"),i=n("./src/pages/shopCar/components/search/index.tsx"),_=n("./src/pages/shopCar/components/RecommendOpen/index.module.scss"),m=n("./src/common/enum.ts"),p=n("./src/api/shopCart.ts"),f=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=(0,r.memo)((function(e){var t=e.shopId,n=e.submitSuccess,x=e.onShow,h=void 0!==x&&x,j=e.onClose,v=(0,r.useState)({id:0,sale_mode:0}),C=(0,a.default)(v,2),g=C[0],b=C[1],w=(0,r.useRef)({sale_mode:0,color_list:[],is_screw_recommend:!0});(0,r.useEffect)((function(){g.id!==t&&b((function(e){return(0,c.default)((0,c.default)({},e),{},{id:t})}))}),[t]);var S=(0,r.useState)(),k=(0,a.default)(S,2),N=k[0],I=k[1],y=(0,p.GetScrewProductApi)().fetchData,V=function(){var e=(0,s.default)((0,o.default)().mark((function _callee(){var e;return(0,o.default)().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,y({id:g.id,sale_mode:g.sale_mode});case 2:(e=t.sent).success&&(e.data=(0,c.default)((0,c.default)({},e.data),{},{sale_mode_type:g.sale_mode}),M(m.SALE_MODE_SETTING[g.sale_mode].defaultNum,e.data.screw_color_id),I(e.data));case 4:case"end":return t.stop()}}),_callee)})));return function getScrewProduct(){return e.apply(this,arguments)}}(),T=(0,r.useState)(!1),D=(0,a.default)(T,2),A=D[0],F=D[1];(0,r.useEffect)((function(){F((function(){return h}))}),[h]),(0,r.useEffect)((function(){A&&V()}),[A,g]);var P=(0,r.useCallback)((function(e){w.current.sale_mode=e.value,b((function(t){return(0,c.default)((0,c.default)({},t),{},{sale_mode:e.value})}))}),[]),E=(0,r.useCallback)((function(e){M(e,null==N?void 0:N.screw_color_id)}),[N]),M=function onSubmitData(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t={product_color_id:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,length:0,roll:0};console.log("num::::",e),0===g.sale_mode?t.roll=e:t.length=(0,d.default)(e).times(100).toNumber(),w.current.color_list=[t]},B=(0,p.AddShoppingCartApi)().fetchData,R=(0,r.useCallback)((0,s.default)((0,o.default)().mark((function _callee2(){return(0,o.default)().wrap((function _callee2$(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,B(w.current);case 2:e.sent.success&&(null==n||n());case 4:case"end":return e.stop()}}),_callee2)}))),[]);return(0,f.jsxs)(f.Fragment,{children:[A&&(0,f.jsxs)(l.View,{className:_.default.recommended_open,children:[(0,f.jsx)(l.View,{className:_.default.search,children:(0,f.jsx)(i.default,{onSelect:P,numberStatus:!1,defaultIndex:g.sale_mode})}),(0,f.jsx)(u.default,{colorItem:N,onChangeNum:E}),(0,f.jsx)(l.View,{className:_.default.onSubmit,onClick:R,children:"确认添加"})]}),A&&(0,f.jsx)(l.View,{catchMove:!0,className:_.default.mask,onClick:function onCloseEven(){null==j||j(),F((function(){return!1}))}})]})}))},"./src/pages/shopCar/components/bottomBtn/index.tsx":function(e,t,n){var o=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),s=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=n("./node_modules/react/cjs/react.production.min.js"),a=n("./node_modules/classnames/index.js"),l=n.n(a),r=n("./src/pages/shopCar/components/bottomBtn/index.module.scss"),d=n("./src/components/checkbox/index.tsx"),u=n("./src/context/ContextShop/index.tsx"),i=n("./src/common/format.ts"),_=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=function(e){var t=e.onSelect,n=e.model,o=e.onBtnClick,s=(0,u.useCurrenShop)(),c=s.state;s.dispatch;return(0,_.jsx)(m,{onSelect:t,statistics:c.statistics,model:n,onBtnClick:o,sale_mode:c.sale_mode})};var m=(0,c.memo)((function(e){var t=e.onSelect,n=e.statistics,a=e.model,u=e.sale_mode,m=(0,c.useState)(!1),p=(0,o.default)(m,2),f=p[0],x=p[1],h=function getSelect(e){x((function(){return e})),null==t||t(e)};(0,c.useEffect)((function(){x(!1)}),[u]);var j=(0,c.useMemo)((function(){return 0===u?"已选".concat(null==n?void 0:n.product_number,"种面料,").concat(null==n?void 0:n.color_number,"个颜色,共").concat(null==n?void 0:n.roll_number,"条"):"已选".concat(null==n?void 0:n.product_number,"种面料,").concat(null==n?void 0:n.color_number,"个颜色,共").concat(((null==n?void 0:n.length_number)||0)/100,"米")}),[n]);return(0,_.jsxs)(s.View,{className:r.default.Settlement_btn,children:[(0,_.jsx)(d.default,{status:f,onSelect:function onSelect(){return h(!0)},onClose:function onClose(){return h(!1)}}),(0,_.jsx)(s.Text,{className:r.default.select_text,children:"全选"}),(0,_.jsx)(s.View,{className:r.default.price_count,children:!a&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(s.View,{className:r.default.price,children:[(0,_.jsx)(s.Text,{children:"预估金额:"}),(0,_.jsxs)(s.Text,{children:["¥",(0,i.formatPriceDiv)(null==n?void 0:n.price_number)]})]}),(0,_.jsx)(s.View,{className:r.default.count,children:j})]})}),(0,_.jsx)(s.View,{onClick:function onBtnClick(){var t;null===(t=e.onBtnClick)||void 0===t||t.call(e,a)},className:l()(r.default.btn,a&&r.default.del),children:a?"删除":"结算"})]})}))},"./src/pages/shopCar/components/colorCheckbox/index.tsx":function(e,t,n){var o=n("./node_modules/react/cjs/react.production.min.js"),s=n("./src/components/checkbox/index.tsx"),c=n("./src/context/ContextShop/index.tsx"),a=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=(0,o.memo)((0,o.forwardRef)((function(e,t){var n=e.colorItem,s=(0,c.useCurrenShop)(),r=s.state,d=s.dispatch,u=n.index_str.split(","),i=(0,o.useCallback)((function(e){r.list[u[0]].color_list[u[1]].checked=!r.list[u[0]].color_list[u[1]].checked;var t=r.list[u[0]].color_list.some((function(e){return e.checked}));r.list[u[0]].checked=t,d({type:"updateProduct",data:{list:r.list}})}),[r.list[u[0]].color_list[u[1]].checked]);return(0,o.useImperativeHandle)(t,(function(){return{onSelect:i}})),(0,a.jsx)(l,{checkStatus:r.list[u[0]].color_list[u[1]].checked,onSelect:i})})));var l=(0,o.memo)((function(e){var t=e.checkStatus,n=e.onSelect,o=function setSelect(e){null==n||n(e)};return(0,a.jsx)(s.default,{status:t,onSelect:function onSelect(){return o(!0)},onClose:function onClose(){return o(!1)}})}))},"./src/pages/shopCar/components/main/index.tsx":function(e,t,n){var o=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),s=n("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),c=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),a=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),l=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),r=n("./node_modules/@tarojs/taro/index.js"),d=n.n(r),u=n("./node_modules/react/cjs/react.production.min.js"),i=n("./src/pages/shopCar/components/productBlock/index.tsx"),_=n("./src/pages/shopCar/components/bottomBtn/index.tsx"),m=n("./src/pages/shopCar/components/operation/index.tsx"),p=n("./src/pages/shopCar/components/search/index.tsx"),f=n("./src/pages/shopCar/components/noShop/index.tsx"),x=n("./src/pages/shopCar/components/RecommendOpen/index.tsx"),h=n("./src/pages/shopCar/components/main/index.module.scss"),j=n("./src/common/enum.ts"),v=n("./src/api/shopCart.ts"),C=n("./src/context/ContextShop/index.tsx"),g=n("./src/components/loadingCard/index.tsx"),b=n("./src/common/common.ts"),w=n("./src/common/util.ts"),S=n("./src/api/user.ts"),k=n("./src/common/system.ts"),N=n("./src/components/bindSalesManDialog/index.tsx"),I=n("./src/reducers/hooks.ts"),y=n("./src/components/organizationNameModal/index.tsx"),V=n("./src/use/useLogin.ts"),T=n("./src/api/company.ts"),D=n("./src/components/moveBtn/index.tsx"),A=n("./src/common/report/event.ts"),F=n("./src/common/format.ts"),P=n("./src/use/useCommon.ts"),E=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=function(){var e,t=(0,C.useCurrenShop)(),n=t.state,M=t.dispatch,B=(0,u.useState)({abstract_sort_key:-1,sale_mode:0}),R=(0,a.default)(B,2),O=R[0],G=R[1];(0,P.useBuriedDataPoint)("pages/shopCar/index");var z=(0,I.useSelector)((function(e){return e.userInfo})),L=(0,u.useTransition)(),H=(0,a.default)(L,2),U=H[0],J=H[1],X=(0,v.GetShoppingCartV2Api)(),Y=X.fetchData,W=X.state,$=function(){var e=(0,c.default)((0,s.default)().mark((function _callee(){var e;return(0,s.default)().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,Y(O);case 2:(e=t.sent).success&&J((function(){var t;M({type:"setInitData",data:{list:JSON.parse(JSON.stringify(null==e||null===(t=e.data)||void 0===t?void 0:t.product_list)),sale_mode:O.sale_mode}})}));case 4:case"end":return t.stop()}}),_callee)})));return function getShoppingCart(){return e.apply(this,arguments)}}(),q=(0,u.useState)({bulk_number:0,length_length:0,weight_number:0}),Z=(0,a.default)(q,2),K=Z[0],Q=Z[1],ee=(0,v.GetProductColorApi)().fetchData,te=function(){var e=(0,c.default)((0,s.default)().mark((function _callee2(){var e;return(0,s.default)().wrap((function _callee2$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,ee();case 2:(e=t.sent).success&&Q(e.data);case 4:case"end":return t.stop()}}),_callee2)})));return function getProductColorNum(){return e.apply(this,arguments)}}(),ne=(0,u.useRef)(!1);(0,r.useDidShow)((function(){te(),ne.current&&$(),ne.current=!0}));var oe=(0,u.useCallback)((function(e){var t;null===(t=n.list)||void 0===t||t.map((function(t){var n;t.checked=e,null===(n=t.color_list)||void 0===n||n.map((function(t){t.checked=e}))})),M({type:"updateProduct",data:{list:n.list}})}),[n.list]);(0,u.useEffect)((function(){$()}),[O]);var se=(0,u.useCallback)((function(e){G((function(t){return(0,o.default)((0,o.default)({},t),{},{abstract_sort_key:e.value})}))}),[]),ce=(0,u.useCallback)((function(e){G((function(t){return(0,o.default)((0,o.default)({},t),{},{sale_mode:e.value})}))}),[]),ae=(0,u.useMemo)((function(){return W.loading||U}),[W.loading,U]),le=(0,u.useState)(!1),re=(0,a.default)(le,2),de=re[0],ue=re[1],ie=(0,u.useCallback)((function(e){ue((function(){return e}))}),[]),_e=(0,v.DelShoppingCartApi)().fetchData,me=(0,u.useRef)(null),pe=(0,u.useState)(!1),fe=(0,a.default)(pe,2),xe=fe[0],he=fe[1],je=(0,S.GetAdminUserInfoApi)().fetchData,ve=(0,S.ApplyOrderAccessApi)().fetchData,Ce=(0,w.throttle)((0,c.default)((0,s.default)().mark((function _callee3(){var e,t,o,c,a;return(0,s.default)().wrap((function _callee3$(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,je();case 2:if(3===(e=s.sent).data.order_access_status){s.next=7;break}return 1==e.data.order_access_status&&ve(),null===(t=me.current)||void 0===t||t.handleChange(!0),s.abrupt("return");case 7:if(!z.adminUserInfo.first_change_name){s.next=10;break}return he(!0),s.abrupt("return");case 10:0==(o=be()).length?b.alert.error("请选择面料"):(a=o.join("-"),(0,k.setParam)({ids:a,sale_mode:n.sale_mode}),console.log("state",n),(0,A.GwcyClickSettlement)({order_type:(null===(c=Object.values(j.SALE_MODE).find((function(e){return e.value===n.sale_mode})))||void 0===c?void 0:c.label)||"",trigger_time:(0,F.formatDateTime)(new Date),purchaser_name:z.adminUserInfo.user_name||"未知用户",purchaser_id:z.adminUserInfo.user_id||0}),(0,b.goLink)("/pages/order/comfirm"));case 12:case"end":return s.stop()}}),_callee3)}))),500),ge=function delShop(){d().showModal({content:"删除所选商品?",success:function success(e){return(0,c.default)((0,s.default)().mark((function _callee4(){var t;return(0,s.default)().wrap((function _callee4$(n){for(;;)switch(n.prev=n.next){case 0:if(!e.confirm){n.next=9;break}return t=be(),console.log("ids:::",t),n.next=5,_e({id:t});case 5:n.sent.success&&($(),te()),n.next=10;break;case 9:e.cancel&&console.log("用户点击取消");case 10:case"end":return n.stop()}}),_callee4)})))()}})},be=function getSelectIds(){var e=[];return n.list.map((function(t){t.color_list.map((function(t){t.checked&&e.push(t.id)}))})),e},we=(0,u.useCallback)((function(){he(!1)}),[]),Se=(0,u.useCallback)((function(e){he(e)}),[]),ke=(0,V.default)().getAdminUserInfo,Ne=(0,T.companyUpdateApi)().fetchData,Ie=(0,T.companyDetailApi)().fetchData,ye=(0,u.useCallback)(function(){var e=(0,c.default)((0,s.default)().mark((function _callee5(e){var t,n;return(0,s.default)().wrap((function _callee5$(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,Ie();case 2:return t=s.sent,s.next=5,Ne((0,o.default)((0,o.default)({},t.data),{},{company_name:e}));case 5:(n=s.sent).success?(ke(),we(),b.alert.success("保存成功")):b.alert.none(n.msg);case 7:case"end":return s.stop()}}),_callee5)})));return function(t){return e.apply(this,arguments)}}(),[]),Ve=(0,u.useCallback)((function(){M({type:"setRecommendId",data:{list:n.list,recommendId:0}})}),[]),Te=(0,u.useCallback)((function(){te(),$()}),[]);return(0,u.useEffect)((function(){n.delCommendId&&($(),te())}),[n.delCommendId]),(0,E.jsx)(D.default,{pageName:"pages/shopCar/index",showList:["order"],customStyles:{overflow:"scroll"},children:(0,E.jsxs)(l.View,{className:h.default.shop_main,children:[(0,E.jsxs)(l.View,{className:h.default.shop_header,children:[(0,E.jsx)(m.default,{onSelect:se,onChange:ie}),(0,E.jsx)(l.View,{className:h.default.search_title,children:(0,E.jsx)(p.default,{numberObj:K,defaultIndex:O.sale_mode,onSelect:ce})})]}),(0,E.jsxs)(l.View,{className:h.default.shop_con,children:[ae&&(0,E.jsx)(l.View,{className:h.default.loading_card,children:(0,E.jsx)(g.default,{})}),!ae&&n.list&&n.list.length>0&&(0,E.jsx)(l.ScrollView,{scrollY:!0,className:h.default.scroll_view,children:null===(e=n.list)||void 0===e?void 0:e.map((function(e){return(0,E.jsx)(i.default,{productItem:e},e.product_id)}))}),!ae&&!n.list&&(0,E.jsx)(f.default,{})]}),(0,E.jsx)(_.default,{onSelect:oe,model:de,onBtnClick:function onBtnClick(e){e?ge():Ce()}}),(0,E.jsx)(l.View,{children:(0,E.jsx)(N.default,{ref:me,onSuccess:function handleBindSalesManSuccess(){z.adminUserInfo.first_change_name&&he(!0)}})}),(0,E.jsx)(l.View,{children:(0,E.jsx)(y.default,{showModal:xe,onClose:we,onShowModalChange:Se,onConfirm:ye})}),(0,E.jsx)(l.View,{children:(0,E.jsx)(x.default,{shopId:n.recommendId||0,onShow:!!n.recommendId,onClose:Ve,submitSuccess:Te})})]})})}},"./src/pages/shopCar/components/noShop/index.tsx":function(e,t,n){var o=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=n("./node_modules/react/cjs/react.production.min.js"),c=n("./src/pages/shopCar/components/noShop/index.module.scss"),a=n("./src/common/common.ts"),l=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=(0,s.memo)((function(){return(0,l.jsxs)(o.View,{className:c.default.empty,onClick:function onClick(){return(0,a.goLink)("/pages/index/index",{},"switchTab")},children:[(0,l.jsx)(o.View,{className:c.default.title,children:"暂未选择商品"}),(0,l.jsx)(o.View,{className:c.default.btn,children:"去选购"})]})}))},"./src/pages/shopCar/components/operation/index.tsx":function(e,t,n){var o=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),s=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=n("./node_modules/react/cjs/react.production.min.js"),a=n("./node_modules/classnames/index.js"),l=n.n(a),r=n("./src/pages/shopCar/components/operation/index.module.scss"),d=n("./src/components/iconfont/iconfont.tsx"),u=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=(0,c.memo)((function(e){var t=e.onSelect,n=(0,c.useState)(!1),a=(0,o.default)(n,2),i=a[0],_=a[1],m=(0,c.useState)({value:-1,title:"添加时间降序"}),p=(0,o.default)(m,2),f=p[0],x=p[1],h=(0,c.useState)(!1),j=(0,o.default)(h,2),v=j[0],C=j[1];return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(s.View,{className:r.default.shop_header_sort_main,children:[(0,u.jsxs)(s.View,{className:r.default.shop_header_sort,children:[(0,u.jsxs)(s.View,{className:r.default.sort,onClick:function onClick(){return _(!0)},children:[(0,u.jsx)(d.default,{name:"icon-paixu1",size:30,color:"#337FFFFF"}),(0,u.jsx)(s.Text,{children:f.title}),(0,u.jsx)(d.default,{name:"icon-zhankai",size:30,color:"#337FFFFF"})]}),(0,u.jsxs)(s.View,{className:r.default.edit,onClick:function onChange(){var t;C(!v),null===(t=e.onChange)||void 0===t||t.call(e,!v)},children:[(0,u.jsx)(d.default,{name:"icon-guanli",size:43,color:"".concat(v?"#337FFFFF":"#000000FF")}),(0,u.jsx)(s.Text,{style:{color:"".concat(v?"#337FFFFF":"#000000FF")},children:v?"取消":"管理"})]})]}),(0,u.jsx)(s.View,{className:l()(r.default.sort_list,i&&r.default.sort_list_selected),children:[{value:-1,title:"添加时间降序"},{value:1,title:"添加时间升序"},{value:-2,title:"面料编号降序"},{value:2,title:"面料编号升序"}].map((function(e){return(0,u.jsx)(s.View,{onClick:function onClick(){return function getSelect(e){_(!1),t(e),x(e)}(e)},className:l()(r.default.item_sort,f.value===e.value&&r.default.search_item_select),children:e.title},e.value)}))})]}),i&&(0,u.jsx)(s.View,{className:r.default.mask,onClick:function onClick(){return _(!1)}})]})}))},"./src/pages/shopCar/components/productBlock/index.tsx":function(e,t,n){var o=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=n("./node_modules/react/cjs/react.production.min.js"),c=n("./src/pages/shopCar/components/productItem/index.tsx"),a=n("./src/pages/shopCar/components/productCheckbox/index.tsx"),l=n("./src/pages/shopCar/components/productBlock/index.module.scss"),r=n("./src/common/format.ts"),d=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=(0,s.memo)((function(e){var t=e.productItem;return(0,s.useEffect)((function(){console.log("productItem66:::",t)}),[t]),(0,d.jsx)(u,{productItem:t,sale_mode:0})}));var u=(0,s.memo)((function(e){var t,n=e.productItem,u=(e.onSelect,e.sale_mode),i=(0,s.useMemo)((function(){return["大货","剪版","删剪"][u]}),[u]);return console.log("productItem22::",n),(0,d.jsxs)(o.View,{className:l.default.shop_product,children:[(0,d.jsxs)(o.View,{className:l.default.shop_product_title,children:[(0,d.jsx)(a.default,{productItem:n}),(0,d.jsx)(o.View,{className:l.default.title_desc,children:(0,d.jsxs)(o.View,{className:l.default.model,children:[(0,d.jsx)(o.Text,{className:l.default.name,children:(0,r.formatHashTag)(null==n?void 0:n.product_code,null==n?void 0:n.product_name)}),(0,d.jsx)(o.Text,{className:l.default.label,children:i})]})})]}),null==n||null===(t=n.color_list)||void 0===t?void 0:t.map((function(e){return(0,d.jsx)(c.default,{colorItem:e},e.product_color_id)}))]})}))},"./src/pages/shopCar/components/productCheckbox/index.tsx":function(e,t,n){var o=n("./node_modules/react/cjs/react.production.min.js"),s=n("./src/components/checkbox/index.tsx"),c=n("./src/context/ContextShop/index.tsx"),a=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=(0,o.memo)((function(e){var t=e.productItem,n=(0,c.useCurrenShop)(),s=n.state,r=n.dispatch,d=t.index_str.split(",")[0],u=(0,o.useCallback)((function(e){var t;s.list[d].checked=e,null===(t=s.list[d].color_list)||void 0===t||t.map((function(t,n){return t.checked=e})),r({type:"updateProduct",data:{list:s.list}})}),[s.list[d].checked]);return(0,a.jsx)(l,{checkStatus:s.list[d].checked,onSelect:u})}));var l=(0,o.memo)((function(e){var t=e.checkStatus,n=e.onSelect,o=function setSelect(e){null==n||n(e)};return(0,a.jsx)(s.default,{status:t,onSelect:function onSelect(){return o(!0)},onClose:function onClose(){return o(!1)}})}))},"./src/pages/shopCar/components/productItem/index.tsx":function(e,t,n){var o=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),s=n("./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js"),c=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),a=n("./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js"),l=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),r=n("./node_modules/@tarojs/taro/index.js"),d=n.n(r),u=n("./node_modules/react/cjs/react.production.min.js"),i=n("./node_modules/big.js/big.mjs"),_=n("./src/pages/shopCar/components/colorCheckbox/index.tsx"),m=n("./src/pages/shopCar/components/recommendProduct/index.tsx"),p=n("./src/pages/shopCar/components/productItem/index.module.scss"),f=n("./src/components/LabAndImg/index.tsx"),x=n("./src/components/counter/index.tsx"),h=n("./src/context/ContextShop/index.tsx"),j=n("./src/common/format.ts"),v=n("./src/api/shopCart.ts"),C=n("./src/common/util.ts"),g=n("./src/common/enum.ts"),b=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=(0,u.memo)((function(e){var t=(0,v.UpdateShoppingCartApi)().fetchData,n=(0,v.GetShoppingCartApi)().fetchData,o=(0,v.DelShoppingCartApi)().fetchData,l=e.colorItem,r=(0,h.useCurrenShop)(),i=r.state,_=r.dispatch,m=l.index_str.split(","),p=i.list[m[0]].color_list[m[1]],f=(0,u.useCallback)(function(){var e=(0,a.default)((0,s.default)().mark((function _callee2(e){var r;return(0,s.default)().wrap((function _callee2$(u){for(;;)switch(u.prev=u.next){case 0:if(0!=e.roll||0!=e.length){u.next=4;break}d().showModal({content:"确定删除该商品?",confirmText:"删除",success:function success(e){return(0,a.default)((0,s.default)().mark((function _callee(){return(0,s.default)().wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(!e.confirm){t.next=7;break}return t.next=3,o({id:[p.id]});case 3:t.sent.success&&_({type:"setDelCommendId",data:{list:i.list,delCommendId:p.id}}),t.next=8;break;case 7:e.cancel&&(i.list[m[0]].color_list[m[1]]=(0,c.default)({},i.list[m[0]].color_list[m[1]]),_({type:"updateProduct",data:{list:i.list}}));case 8:case"end":return t.stop()}}),_callee)})))()}}),u.next=10;break;case 4:return u.next=6,t(e);case 6:return u.next=8,n({id:l.id});case 8:(r=u.sent).success&&(i.list[m[0]].color_list[m[1]]=(0,c.default)((0,c.default)({},i.list[m[0]].color_list[m[1]]),r.data.color_list[0]),_({type:"updateProduct",data:{list:i.list}}));case 10:case"end":return u.stop()}}),_callee2)})));return function(t){return e.apply(this,arguments)}}(),[p]),x=(0,u.useCallback)((function(){_({type:"setRecommendId",data:{list:i.list,recommendId:p.id}})}),[p]);return(0,b.jsx)(w,{colorItem:i.list[m[0]].color_list[m[1]],onChangeNum:f,onSubmitSuccess:x})}));var w=(0,u.memo)((function(e){var t=e.colorItem,n=e.onChangeNum,c=e.onSubmitSuccess,r=(0,u.useMemo)((function(){return{lab:t.lab,rgb:t.rgb,texture_url:t.texture_url,title:t.product_color_code}}),[t]),d=(0,u.useState)(0),h=(0,o.default)(d,2),v=h[0],w=h[1];(0,u.useEffect)((function(){w((function(){return 0===t.sale_mode?t.roll:t.length/100}))}),[t]);var S=(0,C.debounce)(function(){var e=(0,a.default)((0,s.default)().mark((function _callee3(e){var o;return(0,s.default)().wrap((function _callee3$(s){for(;;)switch(s.prev=s.next){case 0:w(e),o={id:t.id,length:0,roll:0},0===t.sale_mode?o.roll=e:o.length=(0,i.default)(e).times(100).toNumber(),null==n||n(o);case 4:case"end":return s.stop()}}),_callee3)})));return function(t){return e.apply(this,arguments)}}(),300),k=g.SALE_MODE_SETTING,N=(0,u.useMemo)((function(){return k[t.sale_mode]}),[t]);console.log("colorItem::",t);var I=(0,u.useRef)(null);return(0,b.jsx)(b.Fragment,{children:(0,b.jsxs)(l.View,{className:p.default.shop_product_item_con,children:[(0,b.jsxs)(l.View,{className:p.default.shop_product_item,children:[(0,b.jsx)(_.default,{colorItem:t,ref:I}),(0,b.jsxs)(l.View,{className:p.default.item_con,onClick:function onClick(){return I.current.onSelect()},children:[(0,b.jsx)(l.View,{className:p.default.img,children:(0,b.jsx)(f.default,{value:r})}),(0,b.jsxs)(l.View,{className:p.default.item_name_price_count,children:[(0,b.jsxs)(l.View,{className:p.default.name_price,children:[(0,b.jsx)(l.Text,{children:t.product_color_code+t.product_color_name}),(0,b.jsxs)(l.View,{className:p.default.price,children:[(0,b.jsx)(l.Text,{}),(0,b.jsxs)(l.Text,{children:["¥",(0,j.formatPriceDiv)(t.sale_price),"/kg"]})]})]}),(0,b.jsxs)(l.View,{className:p.default.count_con,children:[(0,b.jsx)(l.View,{className:p.default.recommend_title,children:t.is_screw_recommend&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(l.Text,{children:"推荐"}),(0,b.jsx)(l.Text,{children:"配套螺纹"})]})}),(0,b.jsx)(l.View,{className:p.default.count,children:(0,b.jsx)(l.CustomWrapper,{children:(0,b.jsx)(x.default,{onClickBtn:S,minNum:N.minNum,maxNum:N.maxNum,onBlue:S,defaultNum:v,unit:0===t.sale_mode?"条":"米",digits:N.digits,returnZero:!0})})})]})]})]})]}),t.has_screw_recommend&&(0,b.jsx)(m.default,{onClick:c})]})})}))},"./src/pages/shopCar/components/recommendProductItem/index.tsx":function(e,t,n){var o=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),s=n("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),c=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),a=n("./node_modules/react/cjs/react.production.min.js"),l=n("./src/pages/shopCar/components/recommendProductItem/index.module.scss"),r=n("./src/components/LabAndImg/index.tsx"),d=n("./src/components/counter/index.tsx"),u=n("./src/common/format.ts"),i=n("./src/common/util.ts"),_=n("./src/common/enum.ts"),m=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=(0,a.memo)((function(e){return(0,m.jsx)(p,(0,s.default)({},e))}));var p=(0,a.memo)((function(e){var t=e.colorItem,n=e.onChangeNum,s=(0,a.useMemo)((function(){return{lab:null==t?void 0:t.lab,rgb:null==t?void 0:t.rgb,texture_url:null==t?void 0:t.texture_url,title:null==t?void 0:t.screw_color_code}}),[t]),p=(0,i.debounce)((function(e){C(e)}),300),f=_.SALE_MODE_SETTING,x=(0,a.useMemo)((function(){return console.log("colorItem123123::",t),t&&f[t.sale_mode_type]}),[null==t?void 0:t.sale_mode_type]),h=(0,a.useState)(0),j=(0,o.default)(h,2),v=j[0],C=j[1];return(0,a.useEffect)((function(){t&&C(f[t.sale_mode_type].defaultNum)}),[null==t?void 0:t.sale_mode_type]),(0,a.useEffect)((function(){null==n||n(v)}),[v]),(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(c.View,{className:l.default.shop_product_item_con,children:(0,m.jsxs)(c.View,{className:l.default.shop_product_item,children:[(0,m.jsx)(c.View,{className:l.default.title_desc,children:(0,m.jsxs)(c.View,{className:l.default.model,children:[(0,m.jsx)(c.Text,{className:l.default.name,children:(0,u.formatHashTag)(null==t?void 0:t.screw_code,null==t?void 0:t.screw_name)}),(0,m.jsx)(c.Text,{className:l.default.label,children:null==x?void 0:x.title})]})}),(0,m.jsxs)(c.View,{className:l.default.item_con,children:[(0,m.jsx)(c.View,{className:l.default.img,children:(0,m.jsx)(r.default,{value:s})}),(0,m.jsxs)(c.View,{className:l.default.item_name_price_count,children:[(0,m.jsxs)(c.View,{className:l.default.name_price,children:[(0,m.jsx)(c.Text,{children:(null==t?void 0:t.screw_color_code)+(null==t?void 0:t.screw_color_name)}),(0,m.jsxs)(c.View,{className:l.default.price,children:[(0,m.jsx)(c.Text,{children:(null==t?void 0:t.standard_price)>(null==t?void 0:t.sale_price)&&0===t.sale_mode_type&&"¥".concat((0,u.formatPriceDiv)(null==t?void 0:t.standard_price))}),(0,m.jsxs)(c.Text,{children:["¥",(0,u.formatPriceDiv)(null==t?void 0:t.sale_price),"/kg"]})]})]}),(0,m.jsx)(c.View,{className:l.default.count,children:(0,m.jsx)(c.CustomWrapper,{children:(0,m.jsx)(d.default,{onClickBtn:p,minNum:null==x?void 0:x.minNum,maxNum:null==x?void 0:x.maxNum,onBlue:p,defaultNum:v,unit:null==x?void 0:x.unit,digits:null==x?void 0:x.digits})})})]})]})]})})})}))},"./src/pages/shopCar/components/recommendProduct/index.tsx":function(e,t,n){var o=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),s=n("./node_modules/react/cjs/react.production.min.js"),c=n("./src/pages/shopCar/components/recommendProduct/index.module.scss"),a=n("./src/components/iconfont/iconfont.tsx"),l=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=(0,s.memo)((function(e){var t=e.onClick;return(0,l.jsx)(o.View,{className:c.default.recommended_main,children:(0,l.jsxs)(o.View,{className:c.default.recommended,onClick:t,children:[(0,l.jsx)(o.Text,{children:"选择专属一对一配套螺纹推荐"}),(0,l.jsx)(o.View,{className:c.default.icon,children:(0,l.jsx)(a.default,{name:"icon-xiala",size:30})})]})})}))},"./src/pages/shopCar/components/search/index.tsx":function(e,t,n){var o=n("./node_modules/@babel/runtime/helpers/esm/slicedToArray.js"),s=n("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=n("./node_modules/react/cjs/react.production.min.js"),a=n("./node_modules/classnames/index.js"),l=n.n(a),r=n("./src/pages/shopCar/components/search/index.module.scss"),d=n("./src/common/enum.ts"),u=n("./node_modules/react/cjs/react-jsx-runtime.production.min.js");t.default=(0,c.memo)((function(e){var t=e.numberStatus,n=void 0===t||t,a=d.SALE_MODE_SETTING,i=e.defaultIndex,_=void 0===i?0:i,m=e.onSelect,p=e.numberObj,f=(0,c.useState)(0),x=(0,o.default)(f,2),h=x[0],j=x[1];(0,c.useEffect)((function(){_!==h&&j(_)}),[_]);var v=function getName(e){return e.title+(n?"(".concat(null==p?void 0:p[e.field],")"):"")};return(0,u.jsx)(s.View,{className:r.default.shop_search,children:null==a?void 0:a.map((function(e){return(0,u.jsx)(s.View,{onClick:function onClick(){return null==m?void 0:m(e)},className:l()(r.default.search_item,h===e.value&&r.default.search_item_select),children:v(e)},e.value)}))})}))},"./src/pages/shopCar/index.tsx":function(e,t,n){var o=n("./node_modules/@tarojs/runtime/dist/runtime.esm.js"),s=n("./node_modules/babel-loader/lib/index.js??ruleSet[1].rules[5].use[0]!./src/pages/shopCar/index.tsx");Page((0,o.createPageConfig)(s.default,"pages/shopCar/index",{root:{cn:[]}},{navigationBarTitleText:"购物车"}||{})),s.default},"./src/pages/shopCar/components/RecommendOpen/index.module.scss":function(e,t){t.default={common_safe_area_y:"index-module__common_safe_area_y___RyqIt",hoverClass:"index-module__hoverClass___PQDWG","full-100":"index-module__full-100___STRxB",recommended_open:"index-module__recommended_open___evO2G",search:"index-module__search___zZaex",onSubmit:"index-module__onSubmit___W0GV7",mask:"index-module__mask___oNOBP"}},"./src/pages/shopCar/components/bottomBtn/index.module.scss":function(e,t){t.default={common_safe_area_y:"index-module__common_safe_area_y___oT95o",hoverClass:"index-module__hoverClass___cTv6H","full-100":"index-module__full-100___c7Dze",Settlement_btn:"index-module__Settlement_btn___fTHki",select_text:"index-module__select_text___zTQjs",price_count:"index-module__price_count___GpC2T",price:"index-module__price___MEOVU",count:"index-module__count___Aussa",btn:"index-module__btn___dBTVw",del:"index-module__del___iwMk8"}},"./src/pages/shopCar/components/main/index.module.scss":function(e,t){t.default={common_safe_area_y:"index-module__common_safe_area_y___XVkd4",hoverClass:"index-module__hoverClass___Txq5z","full-100":"index-module__full-100___uLimf",shop_main:"index-module__shop_main___VJEk3",shop_con:"index-module__shop_con___X4IBn",scroll_view:"index-module__scroll_view___obDmI",shop_header:"index-module__shop_header___P54q_",search_title:"index-module__search_title___VtWaz",loading_card:"index-module__loading_card___mu6JK"}},"./src/pages/shopCar/components/noShop/index.module.scss":function(e,t){t.default={common_safe_area_y:"index-module__common_safe_area_y___vdAI5",hoverClass:"index-module__hoverClass___EkYYL","full-100":"index-module__full-100___nW9Sm",empty:"index-module__empty___GbJms",title:"index-module__title___MDyY5",btn:"index-module__btn___V85Ma"}},"./src/pages/shopCar/components/operation/index.module.scss":function(e,t){t.default={common_safe_area_y:"index-module__common_safe_area_y___SgFdm",hoverClass:"index-module__hoverClass___wSZVH","full-100":"index-module__full-100___a0Xsp",shop_header_sort_main:"index-module__shop_header_sort_main___Ki_a1",shop_header_sort:"index-module__shop_header_sort___FHXag",sort:"index-module__sort___coeeb",edit:"index-module__edit___g1QL_",sort_list:"index-module__sort_list___YmsqR",item_sort:"index-module__item_sort___YSKxM",search_item_select:"index-module__search_item_select___jO8xk",sort_list_selected:"index-module__sort_list_selected___P1rrS",mask:"index-module__mask___JAm1V"}},"./src/pages/shopCar/components/productBlock/index.module.scss":function(e,t){t.default={common_safe_area_y:"index-module__common_safe_area_y___HQ6kv",hoverClass:"index-module__hoverClass___nUkr9","full-100":"index-module__full-100___zTMTo",shop_product:"index-module__shop_product___pTpMG",shop_product_title:"index-module__shop_product_title___Jp7zd",title_desc:"index-module__title_desc___aXuC0",model:"index-module__model___IziQM",name:"index-module__name___Rf6mj",label:"index-module__label___dhWvL",unit:"index-module__unit___m3XPs"}},"./src/pages/shopCar/components/productItem/index.module.scss":function(e,t){t.default={common_safe_area_y:"index-module__common_safe_area_y___ncTsX",hoverClass:"index-module__hoverClass___oHn2J","full-100":"index-module__full-100___ZzXZy",shop_product_item_con:"index-module__shop_product_item_con___rztuO",shop_product_item:"index-module__shop_product_item___WlGlj",item_con:"index-module__item_con___cAPTN",img:"index-module__img___n35HX",item_name_price_count:"index-module__item_name_price_count___sZP7R",name_price:"index-module__name_price___u7zsh",price:"index-module__price___u9uYc",count_con:"index-module__count_con___rr5hg",recommend_title:"index-module__recommend_title___su2GQ",count:"index-module__count___pkmyz",recommended:"index-module__recommended___mQ4ZM",icon:"index-module__icon___mEl2F"}},"./src/pages/shopCar/components/recommendProductItem/index.module.scss":function(e,t){t.default={common_safe_area_y:"index-module__common_safe_area_y___n16wo",hoverClass:"index-module__hoverClass___kc1Ni","full-100":"index-module__full-100___lkU0H",shop_product_item_con:"index-module__shop_product_item_con___XqSrn",shop_product_item:"index-module__shop_product_item___rFxc2",title_desc:"index-module__title_desc___noweV",model:"index-module__model___q3qEH",label:"index-module__label___j3KZ2",item_con:"index-module__item_con___RP4Va",img:"index-module__img___YfAJ5",item_name_price_count:"index-module__item_name_price_count___Letv2",name_price:"index-module__name_price___wF3H1",price:"index-module__price___K8SyH",count:"index-module__count___KWI2i",recommended:"index-module__recommended___jUOjp",icon:"index-module__icon___CwOq7"}},"./src/pages/shopCar/components/recommendProduct/index.module.scss":function(e,t){t.default={common_safe_area_y:"index-module__common_safe_area_y___KCYvH",hoverClass:"index-module__hoverClass___NjRND","full-100":"index-module__full-100___AzYIh",recommended_main:"index-module__recommended_main___WIzv4",recommended:"index-module__recommended___BoUnb",icon:"index-module__icon___uf2F3",recommended_open:"index-module__recommended_open___GVXk5",search:"index-module__search___f5FS7",onSubmit:"index-module__onSubmit___MHl84",mask:"index-module__mask___g5l1f"}},"./src/pages/shopCar/components/search/index.module.scss":function(e,t){t.default={common_safe_area_y:"index-module__common_safe_area_y___MRUYz",hoverClass:"index-module__hoverClass___abLLR","full-100":"index-module__full-100___gRrd8",shop_search:"index-module__shop_search___RfTT0",search_item:"index-module__search_item___Bdsmv",search_item_select:"index-module__search_item_select___CBw_o"}}},function(e){e.O(0,["taro","vendors","common"],(function(){return t="./src/pages/shopCar/index.tsx",e(e.s=t);var t}));e.O()}]);