Aucune description

utils-9c8fdacf.js.map 2.2KB

1
  1. {"version":3,"file":"utils-74f31cae.js","sources":["../src/components/Payment/Utils/utils.ts"],"sourcesContent":["\r\nexport const IMAGE_PROCESS = '?x-oss-process=image/resize,h_350';\r\nexport const IMAGE_PROCESS_SMALL = '?x-oss-process=image/resize,h_100';\r\nexport const IMAGE_PROCESS_LARGE = '?x-oss-process=image/resize,h_500';\r\n\r\ninterface AddImageProcessOptions {\r\n small?: boolean;\r\n large?: boolean;\r\n custom?: boolean;\r\n width?: string;\r\n height?: string;\r\n}\r\n\r\nexport function addImageProcess(url: string, options: AddImageProcessOptions = { width: '36px', height: '36px' }) {\r\n // 防止重复添加导致的url不正确\r\n if (url && url.indexOf('x-oss-process') > -1) {\r\n return url;\r\n }\r\n if (options.small) {\r\n return url + IMAGE_PROCESS_SMALL;\r\n }\r\n if (options.large) {\r\n return url + IMAGE_PROCESS_LARGE;\r\n }\r\n if (options.custom) {\r\n return `${url}?x-oss-process=image/resize,limit_0,m_fill,w_${options.width},h_${options.height}`;\r\n }\r\n return url + IMAGE_PROCESS;\r\n}\r\n\r\nexport function formatMoney(input: any, fuzz = 2) {\r\n if (isNaN(+input)) {\r\n return input;\r\n }\r\n return (+input).toFixed(fuzz);\r\n}\r\n\r\ntype classSize = 'small'|'normal'|'large';\r\n\r\nexport function exportStyleSizeClass(styles: any, size: classSize) {\r\n return {\r\n [styles[size]]: true,\r\n }\r\n}"],"names":["IMAGE_PROCESS","IMAGE_PROCESS_SMALL","IMAGE_PROCESS_LARGE","addImageProcess","url","options","width","height","indexOf","small","large","custom","exportStyleSizeClass","styles","size"],"mappings":";;;;AACO,IAAMA,aAAa,GAAG,mCAAtB;AACP,AAAO,IAAMC,mBAAmB,GAAG,mCAA5B;AACP,AAAO,IAAMC,mBAAmB,GAAG,mCAA5B;AAUP,AAAO,SAASC,eAAT,CAAyBC,GAAzB,EAA2G;MAArEC,OAAqE,uEAAnC;IAAEC,KAAK,EAAE,MAAT;IAAiBC,MAAM,EAAE;GAAU;;;MAE5GH,GAAG,IAAIA,GAAG,CAACI,OAAJ,CAAY,eAAZ,IAA+B,CAAC,CAA3C,EAA8C;WACrCJ,GAAP;;;MAEEC,OAAO,CAACI,KAAZ,EAAmB;WACVL,GAAG,GAAGH,mBAAb;;;MAEEI,OAAO,CAACK,KAAZ,EAAmB;WACVN,GAAG,GAAGF,mBAAb;;;MAEEG,OAAO,CAACM,MAAZ,EAAoB;qBACRP,GAAV,0DAA6DC,OAAO,CAACC,KAArE,gBAAgFD,OAAO,CAACE,MAAxF;;;SAEKH,GAAG,GAAGJ,aAAb;;AAGF,AASO,SAASY,oBAAT,CAA8BC,MAA9B,EAA2CC,IAA3C,EAA4D;uDAE9DD,MAAM,CAACC,IAAD,CADT,EACkB,IADlB;;;;;;"}