vislite
Version:
灵活、快速、简单的数据可视化交互式跨端前端库
20 lines • 696 B
JavaScript
export default function (_this, drawImage) {
return function (imgUrl, x, y, w, h) {
return new Promise((resolve) => {
if (/^http/.test(imgUrl)) {
uni.downloadFile({
url: imgUrl,
success: function (res) {
drawImage.call(_this, res.tempFilePath, x, y, w, h, true).then(() => {
resolve({});
});
},
});
} else {
drawImage.call(_this, imgUrl, x, y, w, h, true).then(() => {
resolve({});
});
}
});
};
};