python学习

This commit is contained in:
2020-11-17 18:52:15 +08:00
parent 780443e7d1
commit 51fd976127
329 changed files with 14341 additions and 358 deletions

22
native/utils/image.js Normal file
View File

@@ -0,0 +1,22 @@
function imageUtil (originalWidth, originalHeight) {
let imageSize = {}
wx.getSystemInfo({
success: function (res) {
const windowWidth = res.windowWidth
imageSize.x = 0
imageSize.y = 0
imageSize.windowWidth = windowWidth
imageSize.imageWidth = originalWidth
imageSize.imageHeight = originalHeight
if (originalWidth > windowWidth) {
imageSize.imageWidth = windowWidth
imageSize.imageHeight = windowWidth * originalHeight / originalWidth
} else {
imageSize.x = (windowWidth - originalWidth) / 2
}
}
})
return imageSize
}
export default imageUtil