This commit is contained in:
parent
bd19e3fc5f
commit
8020780cdc
|
|
@ -26,6 +26,7 @@
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
|
"image-tools": "^1.4.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"pinia": "^2.3.0",
|
"pinia": "^2.3.0",
|
||||||
"pinia-plugin-persistedstate": "^4.2.0",
|
"pinia-plugin-persistedstate": "^4.2.0",
|
||||||
|
|
@ -7790,6 +7791,12 @@
|
||||||
"node": ">= 4"
|
"node": ">= 4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/image-tools": {
|
||||||
|
"version": "1.4.0",
|
||||||
|
"resolved": "https://repo.huaweicloud.com/repository/npm/image-tools/-/image-tools-1.4.0.tgz",
|
||||||
|
"integrity": "sha512-TKtvJ6iUwM0mfaD4keMnk1ENHFC470QEjBfA3IlvKdEOufzvWbjbaoNcoyYq6HlViF8+d5tOS1ooE6j7CHf1lQ==",
|
||||||
|
"license": "ISC"
|
||||||
|
},
|
||||||
"node_modules/immutable": {
|
"node_modules/immutable": {
|
||||||
"version": "4.3.7",
|
"version": "4.3.7",
|
||||||
"resolved": "https://repo.huaweicloud.com/repository/npm/immutable/-/immutable-4.3.7.tgz",
|
"resolved": "https://repo.huaweicloud.com/repository/npm/immutable/-/immutable-4.3.7.tgz",
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
"dayjs": "^1.11.13",
|
"dayjs": "^1.11.13",
|
||||||
|
"image-tools": "^1.4.0",
|
||||||
"lodash-es": "^4.17.21",
|
"lodash-es": "^4.17.21",
|
||||||
"pinia": "^2.3.0",
|
"pinia": "^2.3.0",
|
||||||
"pinia-plugin-persistedstate": "^4.2.0",
|
"pinia-plugin-persistedstate": "^4.2.0",
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
text="识别身份证(人像)"
|
text="识别身份证(人像)"
|
||||||
@tap="onHandleRecognizeIdCard"
|
@tap="onHandleRecognizeIdCard(1)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</up-cell>
|
</up-cell>
|
||||||
|
|
@ -93,7 +93,7 @@
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
text="识别身份证(国徽)"
|
text="识别身份证(国徽)"
|
||||||
@tap="onHandleRecognizeIdCard"
|
@tap="onHandleRecognizeIdCard(2)"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</up-cell>
|
</up-cell>
|
||||||
|
|
@ -153,6 +153,10 @@
|
||||||
|
|
||||||
<script setup name="personIdCardForm">
|
<script setup name="personIdCardForm">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
|
import { pathToBase64 } from 'image-tools'
|
||||||
|
import { useMemberStore } from '@/stores'
|
||||||
|
|
||||||
|
const memberStore = useMemberStore()
|
||||||
const idCardFormRef = ref(null) // 身份证表单ref
|
const idCardFormRef = ref(null) // 身份证表单ref
|
||||||
const idCardModel = ref({
|
const idCardModel = ref({
|
||||||
age: '',
|
age: '',
|
||||||
|
|
@ -322,11 +326,67 @@ const onCancelBirthday = () => {
|
||||||
showPikerBirthday.value = false
|
showPikerBirthday.value = false
|
||||||
}
|
}
|
||||||
|
|
||||||
// 识别身份证(人像面)
|
const imgToBase64Fun = async (path) => {
|
||||||
const onHandleRecognizeIdCard = () => {
|
return new Promise((resolve, reject) => {
|
||||||
|
pathToBase64(path)
|
||||||
|
.then((base64) => {
|
||||||
|
resolve(base64)
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(error)
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 识别身份证(人像面和国徽面)
|
||||||
|
const onHandleRecognizeIdCard = (type) => {
|
||||||
|
// 1人像面 2国徽面
|
||||||
// console.log('识别身份证(人像面)')
|
// console.log('识别身份证(人像面)')
|
||||||
|
|
||||||
uni.$u.toast('功能正在开发中,敬请期待...')
|
uni.$u.toast('功能正在开发中,敬请期待...')
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
|
uni.chooseImage({
|
||||||
|
count: 1, // 最多选择1张图片
|
||||||
|
sizeType: ['original', 'compressed'],
|
||||||
|
sourceType: ['camera', 'album'], // 选择图片的来源
|
||||||
|
success: async (res) => {
|
||||||
|
const base64 = await imgToBase64Fun(res.tempFilePaths[0])
|
||||||
|
const param = {
|
||||||
|
imageBase64: base64.split(',')[1],
|
||||||
|
}
|
||||||
|
|
||||||
|
// 上传后台接口
|
||||||
|
uni.request({
|
||||||
|
url: '/bmw/appRecognition/bankCardRecognition',
|
||||||
|
method: 'POST',
|
||||||
|
data: param,
|
||||||
|
header: {
|
||||||
|
// 'Content-Type': 'application/Json',
|
||||||
|
Authorization: memberStore?.token, // token
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
const { data: result } = res
|
||||||
|
if (result.code === 200) {
|
||||||
|
uni.$u.toast('识别身份证成功')
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('识别身份证失败,请重新识别')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
console.log(err, '----识别身份证失败')
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// uni.$u.toast({
|
||||||
|
// title: '选择图片失败',
|
||||||
|
// icon: 'none',
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 表单校验
|
// 表单校验
|
||||||
|
|
|
||||||
|
|
@ -84,13 +84,27 @@
|
||||||
<text> 1: 未完成工资卡上传为【黄灯人员】</text>
|
<text> 1: 未完成工资卡上传为【黄灯人员】</text>
|
||||||
<text> 2: 生成工资册之前必须上传工资卡</text>
|
<text> 2: 生成工资册之前必须上传工资卡</text>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<up-loading-icon
|
||||||
|
:vertical="true"
|
||||||
|
duration="2000"
|
||||||
|
color="#3c9cff"
|
||||||
|
:show="showLoading"
|
||||||
|
textColor="#3c9cff"
|
||||||
|
text="正在识别中,请稍后..."
|
||||||
|
style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%)"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="wageCardForm">
|
<script setup name="wageCardForm">
|
||||||
import { ref, watch } from 'vue'
|
import { ref, watch } from 'vue'
|
||||||
|
import { pathToBase64 } from 'image-tools'
|
||||||
|
import { useMemberStore } from '@/stores'
|
||||||
|
|
||||||
|
const memberStore = useMemberStore()
|
||||||
const wageCardFormRef = ref(null) // 工资卡见证表单ref
|
const wageCardFormRef = ref(null) // 工资卡见证表单ref
|
||||||
|
const showLoading = ref(false) // 是否显示加载中
|
||||||
|
|
||||||
const wageCardInfoForm = ref({
|
const wageCardInfoForm = ref({
|
||||||
bankName: '', // 银行名称
|
bankName: '', // 银行名称
|
||||||
|
|
@ -250,9 +264,63 @@ const updateWageCardInfo = () => {
|
||||||
Object.assign(wageCardInfoForm.value, props.wageCardInfo)
|
Object.assign(wageCardInfoForm.value, props.wageCardInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const imgToBase64Fun = async (path) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
pathToBase64(path)
|
||||||
|
.then((base64) => {
|
||||||
|
resolve(base64)
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(error)
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 银行卡号识别
|
// 银行卡号识别
|
||||||
const onHandleRecognizeBankCard = () => {
|
const onHandleRecognizeBankCard = () => {
|
||||||
uni.$u.toast('功能正在开发中,敬请期待...')
|
uni.chooseImage({
|
||||||
|
count: 1, // 最多选择1张图片
|
||||||
|
sizeType: ['original', 'compressed'],
|
||||||
|
sourceType: ['camera', 'album'], // 选择图片的来源
|
||||||
|
success: async (res) => {
|
||||||
|
showLoading.value = true
|
||||||
|
const base64 = await imgToBase64Fun(res.tempFilePaths[0])
|
||||||
|
const param = {
|
||||||
|
imageBase64: base64.split(',')[1],
|
||||||
|
}
|
||||||
|
// 上传后台接口
|
||||||
|
uni.request({
|
||||||
|
url: '/bmw/appRecognition/bankCardRecognition',
|
||||||
|
method: 'POST',
|
||||||
|
data: param,
|
||||||
|
header: {
|
||||||
|
Authorization: memberStore?.token, // token
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
showLoading.value = false
|
||||||
|
const { data: result } = res
|
||||||
|
if (result.code === 200) {
|
||||||
|
const { bankCard, bankName } = result.data
|
||||||
|
wageCardInfoForm.value.bankCardCode = bankCard
|
||||||
|
wageCardInfoForm.value.bankName = bankName
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('识别银行卡失败,请重新识别')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
showLoading.value = false
|
||||||
|
uni.$u.toast('识别银行卡失败,请重新识别')
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// uni.$u.toast({
|
||||||
|
// title: '选择图片失败',
|
||||||
|
// icon: 'none',
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 向父组件暴露方法
|
// 向父组件暴露方法
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<!-- 考勤打卡页面 -->
|
<!-- 考勤打卡页面 -->
|
||||||
<view class="attendance-container">
|
<view class="attendance-container app-container">
|
||||||
<view class="project-name"> {{ activeProjectName }}</view>
|
<view class="project-name"> {{ activeProjectName }}</view>
|
||||||
|
|
||||||
<view class="attendance-content">
|
<view class="attendance-content">
|
||||||
|
|
@ -32,18 +32,31 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<up-loading-icon
|
||||||
|
:vertical="true"
|
||||||
|
duration="2000"
|
||||||
|
color="#3c9cff"
|
||||||
|
:show="showLoading"
|
||||||
|
textColor="#3c9cff"
|
||||||
|
text="正在识别中,请稍后..."
|
||||||
|
style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%)"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup name="Attendance">
|
<script setup name="Attendance">
|
||||||
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
||||||
import { useCommonStore } from '@/stores'
|
import { useCommonStore, useMemberStore } from '@/stores'
|
||||||
|
import { pathToBase64 } from 'image-tools'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
|
|
||||||
const commonStore = useCommonStore()
|
const commonStore = useCommonStore()
|
||||||
|
const memberStore = useMemberStore()
|
||||||
const currentTime = ref('') //获取当前的时分秒时间
|
const currentTime = ref('') //获取当前的时分秒时间
|
||||||
const timeInterval = ref(null) //定时器
|
const timeInterval = ref(null) //定时器
|
||||||
const activeProjectName = ref('') // 当前选择的工程名称
|
const activeProjectName = ref('') // 当前选择的工程名称
|
||||||
|
const showLoading = ref(false) // 是否显示加载中
|
||||||
|
|
||||||
// 打卡记录
|
// 打卡记录
|
||||||
const onAttendanceRecord = () => {
|
const onAttendanceRecord = () => {
|
||||||
|
|
@ -66,7 +79,82 @@ const onAttendanceHandle = () => {
|
||||||
// icon: 'none',
|
// icon: 'none',
|
||||||
// })
|
// })
|
||||||
|
|
||||||
uni.$u.toast('功能正在开发中,敬请期待...')
|
uni.chooseImage({
|
||||||
|
count: 1, // 最多选择1张图片
|
||||||
|
sizeType: ['original', 'compressed'],
|
||||||
|
sourceType: ['camera', 'album'], // 选择图片的来源
|
||||||
|
success: (res) => {
|
||||||
|
showLoading.value = true
|
||||||
|
const files = [
|
||||||
|
{
|
||||||
|
file: res.tempFiles[0],
|
||||||
|
name: 'file',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
|
||||||
|
// 先调人脸识别接口检查人脸是否合规
|
||||||
|
uni.uploadFile({
|
||||||
|
url: '/api/bmw/appRecognition/getFaceRecognition',
|
||||||
|
files: files,
|
||||||
|
name: 'file',
|
||||||
|
success: (res) => {
|
||||||
|
showLoading.value = false
|
||||||
|
const data = JSON.parse(res.data)
|
||||||
|
if (data.code === 200) {
|
||||||
|
uni.$u.toast('人脸识别成功')
|
||||||
|
|
||||||
|
// 人脸识别成功后调用打卡接口
|
||||||
|
uni.uploadFile({
|
||||||
|
url: '/api/bmw/appRecognition/appPlayCard',
|
||||||
|
files: files,
|
||||||
|
name: 'file',
|
||||||
|
formData: {
|
||||||
|
params: JSON.stringify({
|
||||||
|
idNumber: data.data.idNumber,
|
||||||
|
}),
|
||||||
|
},
|
||||||
|
success: (res) => {
|
||||||
|
const result = JSON.parse(res.data)
|
||||||
|
if (result.code === 200) {
|
||||||
|
uni.$u.toast('打卡成功')
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('打卡失败:' + result.msg)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
uni.$u.toast('打卡失败:' + err.msg)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('人脸识别失败,请重新识别')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
showLoading.value = false
|
||||||
|
uni.$u.toast('人脸识别失败:' + err.msg)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// uni.$u.toast({
|
||||||
|
// title: '选择图片失败',
|
||||||
|
// icon: 'none',
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const imgToBase64Fun = async (data) => {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
pathToBase64(data)
|
||||||
|
.then((base64) => {
|
||||||
|
resolve(base64)
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error(error)
|
||||||
|
reject(error)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// onMounted生命周期 组件挂载时
|
// onMounted生命周期 组件挂载时
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,16 @@
|
||||||
<text>人员资质查询</text>
|
<text>人员资质查询</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<up-loading-icon
|
||||||
|
:vertical="true"
|
||||||
|
duration="2000"
|
||||||
|
color="#3c9cff"
|
||||||
|
:show="showLoading"
|
||||||
|
textColor="#3c9cff"
|
||||||
|
text="正在识别中,请稍后..."
|
||||||
|
style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%)"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -19,31 +29,51 @@ import { ref } from 'vue'
|
||||||
import FaceIcon from '@/static/image/face.png'
|
import FaceIcon from '@/static/image/face.png'
|
||||||
import CheckIcon from '@/static/image/person-qua.png'
|
import CheckIcon from '@/static/image/person-qua.png'
|
||||||
|
|
||||||
|
const showLoading = ref(false) // 是否显示加载中
|
||||||
|
|
||||||
const onFaceRecognition = () => {
|
const onFaceRecognition = () => {
|
||||||
// uni.$u.toast('功能正在开发中,敬请期待...')
|
|
||||||
// console.log('onFaceRecognition')
|
|
||||||
|
|
||||||
// 打开前置摄像头
|
|
||||||
// uni.scanCode({
|
|
||||||
// scanType: ['barCode', 'qrCode'],
|
|
||||||
// success: (result) => {
|
|
||||||
// console.log(result)
|
|
||||||
// },
|
|
||||||
// })
|
|
||||||
|
|
||||||
uni.chooseImage({
|
uni.chooseImage({
|
||||||
count: 1, // 最多选择1张图片
|
count: 1, // 最多选择1张图片
|
||||||
sizeType: ['original', 'compressed'],
|
sizeType: ['original', 'compressed'],
|
||||||
sourceType: ['camera', 'album'], // 选择图片的来源
|
sourceType: ['camera', 'album'], // 选择图片的来源
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
console.log(res, '----选取的文件')
|
showLoading.value = true
|
||||||
|
const files = [
|
||||||
|
{
|
||||||
|
file: res.tempFiles[0],
|
||||||
|
name: 'file',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
uni.uploadFile({
|
||||||
|
url: '/api/bmw/appRecognition/getFaceRecognition',
|
||||||
|
files: files,
|
||||||
|
name: 'file',
|
||||||
|
success: (res) => {
|
||||||
|
showLoading.value = false
|
||||||
|
const data = JSON.parse(res.data)
|
||||||
|
if (data.code === 200) {
|
||||||
|
uni.$u.toast('人脸识别成功')
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/person-details/index?id=${data.data.userId}`,
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('人脸识别失败,请重新识别')
|
||||||
|
}
|
||||||
},
|
},
|
||||||
fail: (err) => {
|
fail: (err) => {
|
||||||
uni.$u.toast({
|
showLoading.value = false
|
||||||
title: '选择图片失败',
|
uni.$u.toast('人脸识别失败:' + err.msg)
|
||||||
icon: 'none',
|
},
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// uni.$u.toast({
|
||||||
|
// title: '选择图片失败',
|
||||||
|
// icon: 'none',
|
||||||
|
// })
|
||||||
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,16 @@
|
||||||
<view>
|
<view>
|
||||||
<view>{{ item.title }}</view>
|
<view>{{ item.title }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<up-loading-icon
|
||||||
|
:vertical="true"
|
||||||
|
duration="2000"
|
||||||
|
color="#3c9cff"
|
||||||
|
:show="showLoading"
|
||||||
|
textColor="#3c9cff"
|
||||||
|
text="正在识别中,请稍后..."
|
||||||
|
style="position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%)"
|
||||||
|
/>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -20,6 +30,9 @@
|
||||||
import AddIcon from '@/static/image/person/add.png'
|
import AddIcon from '@/static/image/person/add.png'
|
||||||
import EditIcon from '@/static/image/person/edit.png'
|
import EditIcon from '@/static/image/person/edit.png'
|
||||||
import FaceIcon from '@/static/image/person/face.png'
|
import FaceIcon from '@/static/image/person/face.png'
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
const showLoading = ref(false) // 是否显示加载中
|
||||||
|
|
||||||
const handleList = [
|
const handleList = [
|
||||||
{
|
{
|
||||||
|
|
@ -52,13 +65,55 @@ const handleList = [
|
||||||
// 点击跳转
|
// 点击跳转
|
||||||
const handleTapPersonEntry = (item) => {
|
const handleTapPersonEntry = (item) => {
|
||||||
if (item.name === 'face') {
|
if (item.name === 'face') {
|
||||||
uni.$u.toast('功能正在开发中,敬请期待...')
|
uni.chooseImage({
|
||||||
return
|
count: 1, // 最多选择1张图片
|
||||||
|
sizeType: ['original', 'compressed'],
|
||||||
|
sourceType: ['camera', 'album'], // 选择图片的来源
|
||||||
|
success: (res) => {
|
||||||
|
showLoading.value = true
|
||||||
|
const files = [
|
||||||
|
{
|
||||||
|
file: res.tempFiles[0],
|
||||||
|
name: 'file',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
uni.uploadFile({
|
||||||
|
url: '/api/bmw/appRecognition/getFaceRecognition',
|
||||||
|
files: files,
|
||||||
|
name: 'file',
|
||||||
|
success: (res) => {
|
||||||
|
showLoading.value = false
|
||||||
|
const data = JSON.parse(res.data)
|
||||||
|
if (data.code === 200) {
|
||||||
|
uni.$u.toast('人脸识别成功')
|
||||||
|
setTimeout(() => {
|
||||||
|
uni.navigateTo({
|
||||||
|
url: `/pages/person-details/index?id=${data.data.userId}`,
|
||||||
|
})
|
||||||
|
}, 500)
|
||||||
|
} else {
|
||||||
|
uni.$u.toast('人脸识别失败,请重新识别')
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
showLoading.value = false
|
||||||
|
uni.$u.toast('人脸识别失败:' + err.msg)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
},
|
||||||
|
fail: (err) => {
|
||||||
|
// uni.$u.toast({
|
||||||
|
// title: '选择图片失败',
|
||||||
|
// icon: 'none',
|
||||||
|
// })
|
||||||
|
},
|
||||||
|
})
|
||||||
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: item.url,
|
url: item.url,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue