1 line
9.0 KiB
JavaScript
1 line
9.0 KiB
JavaScript
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[693],{2291:function(e,n,t){t.d(n,{Z:function(){return popupModal}});var o=t(9439),i=t(1515),l=t(7294),u="index-module__popup_modal_main___NeFqb",a="index-module__popup_modal_con___t2zmP",r="index-module__popup_modal_title___PcNKB",_="index-module__popup_modal_input___Xx7dz",c="index-module__input___DWA14",s="index-module__popup_modal_btn___Agj6U",d="index-module__popup_modal_btn_item___Ip4cK",m="index-module__mask___wVJDC",f=t(5893),popupModal=function(e){var n=e.show,t=void 0!==n&&n,x=e.title,p=void 0===x?"":x,h=e.onConfirm,v=e.onCancel,g=e.defaultValue,j=void 0===g?"":g,N=e.onClose,C=(0,l.useState)(""),b=(0,o.Z)(C,2),Z=b[0],G=b[1],w=(0,l.useState)(!1),k=(0,o.Z)(w,2),y=k[0],D=k[1];(0,l.useEffect)((function(){Z!==j&&G((function(){return j}))}),[j]),(0,l.useEffect)((function(){t!==y&&D((function(){return t}))}),[t]);var E=function onCloseEven(){null==N||N(),D(!1)};return(0,f.jsx)(f.Fragment,{children:y&&(0,f.jsxs)(i.G7,{className:u,children:[(0,f.jsxs)(i.G7,{className:a,children:[(0,f.jsx)(i.G7,{className:r,children:p}),(0,f.jsx)(i.G7,{className:_,children:(0,f.jsx)(i.G7,{className:c,children:(0,f.jsx)(i.fV,{children:(0,f.jsx)(i.II,{onInput:function onInputEven(e){var n=e.detail.value;G(n)},value:Z,alwaysEmbed:!0,cursorSpacing:200})})})}),(0,f.jsxs)(i.G7,{className:s,children:[(0,f.jsx)(i.G7,{className:d,onClick:function onCancelEven(){null==v||v(),E()},children:"取消"}),(0,f.jsx)(i.G7,{className:d,onClick:function onClick(){return function onConfirmEven(e){null==N||N(),null==h||h(e)}(Z)},children:"确认修改"})]})]}),(0,f.jsx)(i.G7,{className:m,catchMove:!0,onClick:E})]})})}},7899:function(e,n,t){t.d(n,{fc:function(){return s}});var o=t(9439),i=t(7294),l=t.n(i),u=t(5998),a=t(9194),r=t(5893);var _=function createCtx(){var e=l().createContext(void 0);return[function useCtx(){var n=(0,i.useContext)(e);if(void 0===n)throw new Error("useCtx must be inside a Provider with a value");return n},e.Provider]}(),c=(0,o.Z)(_,2),s=c[0],d=c[1];n.ZP=function(e){var n=(0,a.v)((function(e){return e.codeData})),t=(0,u.I0)();return(0,r.jsx)(d,{value:{productData:n,dispatch:t},children:e.children})}},2690:function(e,n,t){t.d(n,{Z:function(){return productItem}});var o=t(9439),i=t(1413),l=t(1515),u=t(7294),a=t(4184),r=t.n(a),_="index-module__product_list__item--con___SHi2B",c="index-module__item_image___yXVeA",s="index-module__item_desc___r9Sk_",d="index-module__item_name_count___kqDDD",m="index-module__name___EFV07",f="index-module__number___dZOJi",x="index-module__item_specs_new___lu9O3",p="index-module__item_specs_old___WxO2i",h="index-module__product_list__item__bottom___LzVs8",v="index-module__product_list_item_height___tz6GI",g=t(6599),j=t(6028),N=t(4158),C=t(2291),b=t(7899),Z=t(5893),productItem=function(e){var n=e.codeItem,t=e.settingColorStatus,o=void 0!==t&&t,l=(0,b.fc)(),a=l.dispatch,r=l.productData,_=n.index_str.split("_"),c=(0,u.useCallback)((function(e){if(r.color_item_data)r.color_item_data.product_color_details[_[1]]=(0,i.Z)((0,i.Z)({},n),{},{product_color_name:e}),a({type:"updateColorData",data:(0,i.Z)({},r.color_item_data)});else{var t=r.data.product_details[_[0]].product_color_details[_[1]];r.data.product_details[_[0]].product_color_details[_[1]]=(0,i.Z)((0,i.Z)({},t),{},{product_color_name:e}),r.data.product_details[_[0]]=(0,i.Z)({},r.data.product_details[_[0]]),a({type:"updateData",data:(0,i.Z)({},r.data),update_status:2})}}),[n]);return(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(G,{codeItem:n,onChange:c,adjust_type:r.adjust_type,settingColorStatus:o})})},G=(0,u.memo)((function(e){var n=e.codeItem,t=(e.adjust_type,e.settingColorStatus),i=(0,u.useState)(!1),a=(0,o.Z)(i,2),b=a[0],G=a[1],w=(0,u.useState)(""),k=(0,o.Z)(w,2),y=k[0],D=k[1];console.log("codeItem内容:::",n);var E=(0,u.useMemo)((function(){return{old:"重量:".concat((0,N.$y)(null==n?void 0:n.weight_setting),"kg")+"".concat(0===n.sale_mode?"|空差: ".concat((0,N.$y)(null==n?void 0:n.weight_error_setting),"kg"):"")+"|单价:¥".concat((0,N.yb)(null==n?void 0:n.price_setting),"/kg"),new:"重量:".concat((0,N.$y)(null==n?void 0:n.original_weight),"kg")+"".concat(0===n.sale_mode?"|空差: ".concat((0,N.$y)(null==n?void 0:n.original_weight_error),"kg"):"")+"|单价:¥".concat((0,N.$y)(null==n?void 0:n.original_price),"/kg")}}),[n]),I=(0,u.useMemo)((function(){return{lab:n.lab,rgb:n.rgb,texture_url:n.texture_url}}),[n]),S=(0,u.useMemo)((function(){return 0==n.sale_mode?"".concat(null==n?void 0:n.roll,"条"):"".concat((null==n?void 0:n.length)/100,"米")}),[n]);return(0,Z.jsxs)(l.G7,{className:r()(_,t?v:h),children:[(0,Z.jsx)(l.G7,{className:c,children:(0,Z.jsx)(g.Z,{value:I})}),(0,Z.jsxs)(l.G7,{className:s,children:[(0,Z.jsxs)(l.G7,{className:d,children:[(0,Z.jsxs)(l.G7,{className:m,onClick:function onUpdate(){console.log("点击了"),D(n.product_color_name),G(!0)},children:[(0,Z.jsx)(l.xv,{children:null==n?void 0:n.product_color_name}),(0,Z.jsx)(j.Z,{name:"icon-shuru",size:50})]}),(0,Z.jsxs)(l.G7,{className:f,children:["x",S]})]}),(0,Z.jsx)(l.G7,{className:x,children:E.old}),!t&&(0,Z.jsx)(l.G7,{className:p,children:E.new})]}),(0,Z.jsx)(l.G7,{className:"common_ellipsis"}),(0,Z.jsx)(C.Z,{show:b,title:"修改面料名称",defaultValue:y,onClose:function onClose(){return G(!1)},onConfirm:function onConfirm(n){var t;null===(t=e.onChange)||void 0===t||t.call(e,n)}})]})}))},6247:function(e,n,t){t.d(n,{Z:function(){return settingNumber}});var o=t(1413),i=t(9439),l=t(1515),u=t(7294),a=t(3012),r=t(4184),_=t.n(r),c={common_safe_area_y:"index-module__common_safe_area_y___MayD0",hoverClass:"index-module__hoverClass___kfMCf","full-100":"index-module__full-100___aomSt",main:"index-module__main___zXxNZ",btn:"index-module__btn___esYj_",left_btn:"index-module__left_btn___Ob616",right_btn:"index-module__right_btn____CVHE",input:"index-module__input___ENI_8"},s=t(5893),d=function CounterDisplayName(e){var n=e.minNum,t=void 0===n?0:n,r=e.maxNum,d=void 0===r?1e4:r,m=e.step,f=void 0===m?1:m,x=e.digits,p=void 0===x?0:x,h=e.defaultNum,v=void 0===h?0:h,g=e.onChange,j=e.onBlue,N=e.onClickBtn,C=e.returnZero,b=void 0!==C&&C,Z=e.unit,G=void 0===Z?"":Z,w=e.disabled,k=void 0!==w&&w,y=(0,u.useState)({count:v}),D=(0,i.Z)(y,2),E=D[0],I=D[1],S=function formatDigits(e){if((e="".concat(e)).includes(".")){var n=e.split(".");if(p>0){var t=n[1].substr(0,p);return"".concat(n[0],".").concat(t)}return n[0]}return parseFloat(e)};(0,u.useEffect)((function(){I({count:v})}),[v]);return(0,s.jsxs)(l.G7,{className:c.main,onClick:function onClick(e){return e.stopPropagation()},children:[(0,s.jsx)(l.G7,{className:_()(c.btn,c.left_btn),onClick:function onClick(){return function minus(){if(k)return!1;var e=E.count,n=(0,a.Z)(e).minus(f).toNumber();n=b?n<t?0:n:n<t?t:n,I((0,o.Z)((0,o.Z)({},E),{},{count:n})),null==g||g(parseFloat(n)),null==N||N(parseFloat(n))}()},children:"-"}),(0,s.jsxs)(l.G7,{className:c.input,children:[(0,s.jsx)(l.II,{type:"digit",value:E.count,onInput:function onInputEven(e){},onBlur:function onBluerEven(e){var n=parseFloat(e.detail.value);if(""==e.detail.value)null==j||j(t<0?0:t),I({count:t<0?0:t});else if(Number.isNaN(n))I({count:t}),null==j||j(t);else{var o=S(n);o=function checkData(e){var n=parseFloat(e);return n>d?d:n<t?t:e}(o),I({count:o}),null==j||j(o)}},disabled:k,alwaysEmbed:!0,cursorSpacing:150}),(0,s.jsx)(l.G7,{className:c.unit,children:G})]}),(0,s.jsx)(l.G7,{className:_()(c.btn,c.right_btn),onClick:function onClick(){return function onPlus(){if(k)return!1;var e=E.count,n=(0,a.Z)(e).add(f).toNumber();n=S(n=n>=d?d:n),I((0,o.Z)((0,o.Z)({},E),{},{count:n})),null==g||g(parseFloat(n)),null==N||N(parseFloat(n))}()},children:"+"})]})},m=(0,u.memo)(d),f=function CounterWithMemo(e){return(0,s.jsx)(m,(0,o.Z)({},e))},x=(0,u.memo)(f),p="index-module__change_count___PnJRp",h="index-module__change_count__item___DoArg",v="index-module__change_count__item--title___BOr3v",g=t(8093),settingNumber=function(e){var n=e.onNumber,t=e.defaultValue,a=e.sale_mode,r=(0,u.useState)({weight:0,weight_error:0,sale_price:0}),_=(0,i.Z)(r,2),c=_[0],d=_[1];(0,u.useEffect)((function(){t&&d((function(){return t}))}),[t]);var m=(0,g.Ds)((function(e,t){null==n||n(e,t),"weight"===t?c.weight=e:"sale_price"===t?c.sale_price=e:c.weight_error=e,d((function(){return(0,o.Z)({},c)}))}),300);return(0,s.jsxs)(l.G7,{className:p,children:[(0,s.jsxs)(l.G7,{className:h,children:[(0,s.jsx)(l.G7,{className:v,children:"重量"}),(0,s.jsx)(l.fV,{children:(0,s.jsx)(x,{defaultNum:c.weight,minNum:-1e3,digits:2,onChange:function onChange(e){return m(e,"weight")},onBlue:function onBlue(e){return m(e,"weight")}})})]}),0===a&&(0,s.jsxs)(l.G7,{className:h,children:[(0,s.jsx)(l.G7,{className:v,children:"空差"}),(0,s.jsx)(l.fV,{children:(0,s.jsx)(x,{defaultNum:c.weight_error,minNum:-1e3,digits:2,onChange:function onChange(e){return m(e,"weight_error")},onBlue:function onBlue(e){return m(e,"weight_error")}})})]}),(0,s.jsxs)(l.G7,{className:h,children:[(0,s.jsx)(l.G7,{className:v,children:"单价"}),(0,s.jsx)(l.fV,{children:(0,s.jsx)(x,{defaultNum:c.sale_price,minNum:-1e3,digits:2,onChange:function onChange(e){return m(e,"sale_price")},onBlue:function onBlue(e){return m(e,"sale_price")}})})]})]})}}}]); |