PDF 优化

This commit is contained in:
binbin_pan 2024-09-18 09:18:21 +08:00
parent 7934c43ecd
commit d3a2ea6340
1 changed files with 26 additions and 24 deletions

View File

@ -153,30 +153,32 @@ export default {
//
openPhotograph() {
this.isHide = true
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['camera'],
success: res => {
let url = ''
console.log('🚀 ~ res-拍照:', res)
this.imgToBase64(res.tempFilePaths[0]).then(base64 => {
url = base64
console.log('🚀 ~ this.imgToBase64 ~ base64:', url)
this.getFaceRecognition({ userId: uni.getStorageSync('userId'), img: url })
})
},
fail(err) {
console.log('🚀 ~ openFaceScan ~ 人脸识别失败', err)
uni.showToast({
title: '人脸识别失败',
icon: ''
})
setTimeout(() => {
this.updStudyDuration()
}, 1000)
}
})
setTimeout(() => {
uni.chooseImage({
count: 1,
sizeType: ['compressed'],
sourceType: ['camera'],
success: res => {
let url = ''
console.log('🚀 ~ res-拍照:', res)
this.imgToBase64(res.tempFilePaths[0]).then(base64 => {
url = base64
console.log('🚀 ~ this.imgToBase64 ~ base64:', url)
this.getFaceRecognition({ userId: uni.getStorageSync('userId'), img: url })
})
},
fail(err) {
console.log('🚀 ~ openFaceScan ~ 人脸识别失败', err)
uni.showToast({
title: '人脸识别失败',
icon: ''
})
setTimeout(() => {
this.updStudyDuration()
}, 1000)
}
})
}, 500)
},
imgToBase64(data) {
return new Promise((resolve, reject) => {