1 |
- {"version":3,"file":"utils-6b513b37.js","sources":["../src/components/Payment/Utils/utils.ts"],"sourcesContent":["\nexport const IMAGE_PROCESS = '?x-oss-process=image/resize,h_350';\nexport const IMAGE_PROCESS_SMALL = '?x-oss-process=image/resize,h_100';\nexport const IMAGE_PROCESS_LARGE = '?x-oss-process=image/resize,h_500';\n\ninterface AddImageProcessOptions {\n small?: boolean;\n large?: boolean;\n custom?: boolean;\n width?: string;\n height?: string;\n}\n\nexport function addImageProcess(url: string, options: AddImageProcessOptions = { width: '36px', height: '36px' }) {\n // 防止重复添加导致的url不正确\n if (url && url.indexOf('x-oss-process') > -1) {\n return url;\n }\n if (options.small) {\n return url + IMAGE_PROCESS_SMALL;\n }\n if (options.large) {\n return url + IMAGE_PROCESS_LARGE;\n }\n if (options.custom) {\n return `${url}?x-oss-process=image/resize,limit_0,m_fill,w_${options.width},h_${options.height}`;\n }\n return url + IMAGE_PROCESS;\n}\n\nexport function formatMoney(input: any, fuzz = 2) {\n if (isNaN(+input)) {\n return input;\n }\n return (+input).toFixed(fuzz);\n}\n\ntype classSize = 'small'|'normal'|'large';\n\nexport function exportStyleSizeClass(styles: any, size: classSize) {\n return {\n [styles[size]]: true,\n }\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;AACA,IAAMC,mBAAmB,GAAG,mCAA5B;AACA,IAAMC,mBAAmB,GAAG,mCAA5B;AAUD,SAAUC,eAAV,CAA0BC,GAA1B,EAA0G;MAAnEC,OAAmE,uEAAjC;AAAEC,IAAAA,KAAK,EAAE,MAAT;AAAiBC,IAAAA,MAAM,EAAE;AAAzB;;MAEzEH,GAAG,IAAIA,GAAG,CAACI,OAAJ,CAAY,eAAZ,IAA+B,CAAC,GAAG;WACrCJ;;;MAELC,OAAO,CAACI,OAAO;WACVL,GAAG,GAAGH;;;MAEXI,OAAO,CAACK,OAAO;WACVN,GAAG,GAAGF;;;MAEXG,OAAO,CAACM,QAAQ;qBACRP,6DAAmDC,OAAO,CAACC,qBAAWD,OAAO,CAACE;;;SAEnFH,GAAG,GAAGJ;;AAYT,SAAUY,oBAAV,CAA+BC,MAA/B,EAA4CC,IAA5C,EAA2D;6BAE5DD,MAAM,CAACC,IAAD,GAAS;;;;;"}
|