This commit is contained in:
parent
16f8ae697a
commit
a5feed46f7
|
|
@ -156,7 +156,7 @@ const handlePhoto = () => {
|
|||
})
|
||||
}
|
||||
// 拍照
|
||||
function getCamera() {
|
||||
const getCamera = () => {
|
||||
navigator.camera.getPicture(onCameraSuccess, onCameraError, {
|
||||
quality: 50,
|
||||
destinationType: window.Camera.DestinationType.DATA_URL,
|
||||
|
|
@ -164,7 +164,7 @@ function getCamera() {
|
|||
})
|
||||
}
|
||||
// 从相册选择
|
||||
function getPhoto() {
|
||||
const getPhoto = () => {
|
||||
navigator.camera.getPicture(onCameraSuccess, onCameraError, {
|
||||
quality: 50,
|
||||
destinationType: window.Camera.DestinationType.DATA_URL,
|
||||
|
|
@ -172,10 +172,10 @@ function getPhoto() {
|
|||
})
|
||||
}
|
||||
|
||||
function onCameraError(message) {
|
||||
const onCameraError = (message) => {
|
||||
console.log('🚀 ~ onCameraError ~ message:', message)
|
||||
}
|
||||
async function onCameraSuccess(file) {
|
||||
const onCameraSuccess = (file) => {
|
||||
// const file1 = "data:image/jpeg;base64," + file;
|
||||
const file1 = file
|
||||
let params = {
|
||||
|
|
@ -195,9 +195,10 @@ async function onCameraSuccess(file) {
|
|||
leaseSignType: signType.value,
|
||||
}
|
||||
console.log('🚀 ~ success: ~ params:', params)
|
||||
const res = await updateLeaseApplyInfoSign(params)
|
||||
console.log('🚀 ~ uploadImg-领料 ~ res:', res)
|
||||
uni.navigateBack()
|
||||
updateLeaseApplyInfoSign(params).then((res) => {
|
||||
console.log('🚀 ~ uploadImg-领料 ~ res:', res)
|
||||
uni.navigateBack()
|
||||
})
|
||||
} else if (opts.isBack) {
|
||||
const params = {
|
||||
id: opts.id,
|
||||
|
|
@ -205,17 +206,19 @@ async function onCameraSuccess(file) {
|
|||
backSignType: signType.value,
|
||||
}
|
||||
console.log('🚀 ~ success: ~ params:', params)
|
||||
const res = await updateSignById(params)
|
||||
console.log('🚀 ~ uploadImg-退料 ~ res:', res)
|
||||
uni.navigateBack()
|
||||
updateSignById(params).then((res) => {
|
||||
console.log('🚀 ~ uploadImg-退料 ~ res:', res)
|
||||
uni.navigateBack()
|
||||
})
|
||||
} else {
|
||||
const params = {
|
||||
signUrl: signUrl,
|
||||
signType: signType.value,
|
||||
}
|
||||
const res = await updateSign(params)
|
||||
console.log('🚀 ~ uploadImg-个人中心 ~ res:', res)
|
||||
getSignData()
|
||||
updateSign(params).then((res) => {
|
||||
console.log('🚀 ~ uploadImg-个人中心 ~ res:', res)
|
||||
getSignData()
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ uploadImg ~ error:', error)
|
||||
|
|
|
|||
Loading…
Reference in New Issue