From a0682337adb852f8dda5a59e665402484ca22045 Mon Sep 17 00:00:00 2001 From: icssoa <615206459@qq.com> Date: Sun, 3 Aug 2025 16:19:19 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E5=B8=83=E9=AB=98=E6=B8=85=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cool/utils/device.ts | 14 ++++++++ cool/utils/index.ts | 7 ++-- .../components/cl-cropper/cl-cropper.uvue | 19 +++++----- .../cl-progress-circle.uvue | 35 ++++++++----------- .../cool-ui/components/cl-sign/cl-sign.uvue | 32 +++++++---------- 5 files changed, 56 insertions(+), 51 deletions(-) create mode 100644 cool/utils/device.ts 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 @@