feat: 准备修改header的渲染
This commit is contained in:
@@ -15,3 +15,23 @@ export function setCanvasSize(canvas: Canvas, paperSize: PaperSize) {
|
||||
console.log('canvas----:', canvas);
|
||||
return canvas;
|
||||
}
|
||||
|
||||
export async function getMiniCodeImagePath() {
|
||||
return getImagePath('/assets/imgs/mini-code.jpg');
|
||||
}
|
||||
|
||||
export async function getImagePath(path: string) {
|
||||
return new Promise((resolve) => {
|
||||
// 如果是网络图片,需配置downloadFile域名
|
||||
wx.getImageInfo({
|
||||
src: path, // 本地图片路径
|
||||
success: (res) => {
|
||||
resolve(res.path);
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('图片加载失败:', err);
|
||||
resolve(''); // 可设置默认占位图
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user