fix: 修改分享初始化逻辑、去除小猫图

This commit is contained in:
2026-02-08 23:58:37 +08:00
parent 70a66fabdc
commit 28955e9da1
3 changed files with 38 additions and 27 deletions

View File

@@ -35,12 +35,21 @@ export function base64ToTempFilePath(base64Data: string): Promise<string> {
}
interface TaroGetImageInfo {
getImageInfo(option: {
src: string;
success?: (res: { width: number; height: number }) => void;
fail?: (err: unknown) => void;
}): void;
}
/** 获取图片宽高 */
function getImageWh(src: string): Promise<{ width: number; height: number }> {
return new Promise((resolve) => {
Taro.getImageInfo({
return new Promise((resolve, reject) => {
(Taro as TaroGetImageInfo).getImageInfo({
src,
success: ({ width, height }) => resolve({ width, height }),
fail: (e) => reject(e),
});
});
}