//图片选择
chooseImgH5() {
const that = this
uni.chooseImage({
sizeType: ['original'],
sourceType: ['album', 'camera'],
count: 1,
success: (response) => {
uni.showLoading({
title: '加载中'
})
//获取图片后进行格式转换,response.tempFilePaths[0]为选择的图片
that.getBase64(response.tempFilePaths[0])
}
})
},
//图片格式转换
getBase64(imgUrl) {
var Img = new Image(),
dataURLs = '';
Img.setAttribute("crossOrigin", 'Anonymous