|
|
|
@ -4,17 +4,23 @@ var unit ={ |
|
|
|
|
|
|
|
|
|
getImgInfo:function(filePath){ |
|
|
|
|
function getInfo(resolve, reject) { |
|
|
|
|
uni.getImageInfo({ |
|
|
|
|
src: filePath, |
|
|
|
|
success: function (image) { |
|
|
|
|
resolve(image); |
|
|
|
|
}, |
|
|
|
|
fail: (res) => { |
|
|
|
|
reject(res); |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
uni.getImageInfo({ |
|
|
|
|
src: filePath, |
|
|
|
|
success: function (image) { |
|
|
|
|
resolve(image); |
|
|
|
|
}, |
|
|
|
|
fail: (res) => { |
|
|
|
|
reject(res); |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
return new Promise(getInfo); |
|
|
|
|
} catch (error) { |
|
|
|
|
console.log(error) |
|
|
|
|
}
|
|
|
|
|
} |
|
|
|
|
return new Promise(getInfo); |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
compressImg:function(filePath, config = {}){ |
|
|
|
|