diff --git a/cool/utils/device.ts b/cool/utils/device.ts new file mode 100644 index 0000000..0d51a0d --- /dev/null +++ b/cool/utils/device.ts @@ -0,0 +1,14 @@ +/** + * 获取设备像素比 + * @returns 设备像素比 + */ +export const getDevicePixelRatio = (): number => { + const dpr = uni.getDeviceInfo().devicePixelRatio ?? 1; + + // #ifdef MP + // 微信小程序高清处理 + return 3; + // #endif + + return dpr; +}; diff --git a/cool/utils/index.ts b/cool/utils/index.ts index edf6565..24df802 100644 --- a/cool/utils/index.ts +++ b/cool/utils/index.ts @@ -1,6 +1,7 @@ export * from "./comm"; -export * from "./storage"; -export * from "./path"; export * from "./day"; -export * from "./parse"; +export * from "./device"; export * from "./file"; +export * from "./parse"; +export * from "./path"; +export * from "./storage"; diff --git a/uni_modules/cool-ui/components/cl-cropper/cl-cropper.uvue b/uni_modules/cool-ui/components/cl-cropper/cl-cropper.uvue index cf0dcec..0c1126e 100644 --- a/uni_modules/cool-ui/components/cl-cropper/cl-cropper.uvue +++ b/uni_modules/cool-ui/components/cl-cropper/cl-cropper.uvue @@ -132,7 +132,7 @@