1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 'use strict';
-
- var _commonjsHelpers = require('./_commonjsHelpers-4ed3570f.js');
-
- var IMAGE_PROCESS = '?x-oss-process=image/resize,h_350';
- var IMAGE_PROCESS_SMALL = '?x-oss-process=image/resize,h_100';
- var IMAGE_PROCESS_LARGE = '?x-oss-process=image/resize,h_500';
- function addImageProcess(url) {
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
- width: '36px',
- height: '36px'
- };
-
- // 防止重复添加导致的url不正确
- if (url && url.indexOf('x-oss-process') > -1) {
- return url;
- }
-
- if (options.small) {
- return url + IMAGE_PROCESS_SMALL;
- }
-
- if (options.large) {
- return url + IMAGE_PROCESS_LARGE;
- }
-
- if (options.custom) {
- return "".concat(url, "?x-oss-process=image/resize,limit_0,m_fill,w_").concat(options.width, ",h_").concat(options.height);
- }
-
- return url + IMAGE_PROCESS;
- }
- function formatMoney(input) {
- var fuzz = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
-
- if (isNaN(+input)) {
- return input;
- }
-
- return (+input).toFixed(fuzz);
- }
- function exportStyleSizeClass(styles, size) {
- return _commonjsHelpers._defineProperty({}, styles[size], true);
- }
-
- exports.addImageProcess = addImageProcess;
- exports.exportStyleSizeClass = exportStyleSizeClass;
- exports.formatMoney = formatMoney;
- //# sourceMappingURL=utils-ed518bfc.js.map
|