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