TestEShopDist/dist/pages/details/sub-common/42aa399095655e26e89ff8601d93d33a.js
2023-05-12 11:43:37 +08:00

2 lines
3.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see 42aa399095655e26e89ff8601d93d33a.js.LICENSE.txt */
"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([["sub-common/42aa399095655e26e89ff8601d93d33a"],{"./src/components/shopCart/components/productItem/index.tsx":function(e,s,t){var a=t("./node_modules/@babel/runtime/helpers/esm/objectSpread2.js"),l=t("./node_modules/@tarojs/plugin-platform-weapp/dist/components-react.js"),c=t("./node_modules/react/cjs/react.production.min.js"),n=t("./node_modules/classnames/index.js"),o=t.n(n),d=t("./node_modules/big.js/big.mjs"),u=t("./src/components/shopCart/components/productItem/index.module.scss"),r=t("./src/components/checkbox/index.tsx"),i=t("./src/components/counter/index.tsx"),m=t("./src/components/LabAndImg/index.tsx"),f=t("./src/common/format.ts"),p=t("./node_modules/react/cjs/react-jsx-runtime.production.min.js"),x=function ProductItem(e){var s=e.onChangeCount,t=e.onChangeSelect,n=e.item,x=e.sale_model,_=(0,c.useCallback)((function(){t((0,a.default)((0,a.default)({},n),{},{selected:!0}))}),[n]),j=(0,c.useCallback)((function(){t((0,a.default)((0,a.default)({},n),{},{selected:!1}))}),[n]),b=(0,c.useCallback)((function(){}),[]),h=(0,c.useCallback)((function(e){var t=0==n.sale_mode?parseFloat(e):0,l=0!=n.sale_mode?parseFloat(new d.default(parseFloat(e)).times(100)):0;s((0,a.default)((0,a.default)({},n),{},{roll:t,length:l}))}),[n]),w=(0,c.useMemo)((function(){return{lab:n.lab,rgb:n.rgb,texture_url:n.texture_url,title:n.product_color_code}}),[n]);(0,c.useCallback)((function(){x==n.sale_mode&&t((0,a.default)((0,a.default)({},n),{},{selected:!n.selected}))}),[n]);console.log("刷新2",n);var N=(0,c.useCallback)((function(e){return Number((0,f.formatPriceDiv)(e))}),[]),g=(0,c.useCallback)((function(e){return 0==e.sale_mode?e.roll:e.length/100}),[]),C=(0,c.useCallback)((function(e){return 0==e.sale_mode?"条":"米"}),[]),k=(0,c.useMemo)((function(){return x!=n.sale_mode}),[n]);return(0,p.jsxs)(l.View,{className:o()(u.default.product_item,k&&u.default.no_product_item_select),children:[(0,p.jsx)(l.View,{className:u.default.checkbox,children:(0,p.jsx)(r.default,{status:n.selected,onSelect:_,onClose:j,disabled:k})}),(0,p.jsx)(l.View,{className:u.default.img,children:(0,p.jsx)(m.default,{value:w,showStatus:!1,onClick:b})}),(0,p.jsxs)(l.View,{className:u.default.product_item_name,children:[(0,p.jsxs)(l.View,{className:u.default.product_item_name_header,children:[(0,p.jsx)(l.View,{className:u.default.title,children:(0,f.formatHashTag)(n.product_code,n.product_name)}),(0,p.jsxs)(l.View,{className:u.default.price,children:[(0,p.jsx)(l.Text,{children:"¥"}),N(n.sale_price),(0,p.jsxs)(l.Text,{children:["/",n.eunit]})]})]}),(0,p.jsxs)(l.View,{className:u.default.count,children:[(0,p.jsxs)(l.View,{className:u.default.des,children:[(0,p.jsx)(l.View,{className:u.default.subtitle,children:"".concat(n.product_color_code," ").concat(n.product_color_name)}),(0,p.jsx)(l.View,{className:u.default.tag,children:n.sale_mode_name})]}),(0,p.jsx)(l.View,{className:u.default.btn_count,children:(0,p.jsx)(i.default,{onBlue:h,defaultNum:g(n),step:n.step,digits:n.digits,onClickBtn:h,unit:C(n),minNum:n.minNum,maxNum:n.maxNum,disabled:k})})]})]})]})};s.default=(0,c.memo)(x)}}]);