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