|
@@ -178,34 +178,52 @@
|
|
|
// 上传
|
|
// 上传
|
|
|
handleOkClick() {
|
|
handleOkClick() {
|
|
|
// 这里的 this.tempImg 是经过人脸检测后 拍照拿到的路径
|
|
// 这里的 this.tempImg 是经过人脸检测后 拍照拿到的路径
|
|
|
- this.upLoadOne()
|
|
|
|
|
|
|
+ this.upLoadOne(this.tempImg)
|
|
|
},
|
|
},
|
|
|
- upLoadOne() {
|
|
|
|
|
|
|
+ upLoadOne(url) {
|
|
|
uni.showLoading({
|
|
uni.showLoading({
|
|
|
title: "检测中,请稍后...",
|
|
title: "检测中,请稍后...",
|
|
|
});
|
|
});
|
|
|
- setTimeout(async () => {
|
|
|
|
|
- let res = await this.$myRequest_clockIn({
|
|
|
|
|
- url: "/attendance/api/sign/check/in/update",
|
|
|
|
|
- method: "put",
|
|
|
|
|
- header: {
|
|
|
|
|
- 'Authorization': uni.getStorageSync("token")
|
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ uni.uploadFile({
|
|
|
|
|
+ url: `https://www.web-server.top/attendance/api/file/upload`,
|
|
|
|
|
+ filePath: url,
|
|
|
|
|
+ name: 'file',
|
|
|
|
|
+ success: (uploadFileRes) => {
|
|
|
|
|
+ let imgUrl = JSON.parse(uploadFileRes.data)
|
|
|
|
|
+ .data
|
|
|
|
|
+ this.handleUploading(imgUrl)
|
|
|
},
|
|
},
|
|
|
- data: {
|
|
|
|
|
- id: this.id,
|
|
|
|
|
- lat: this.lat,
|
|
|
|
|
- lng: this.lng,
|
|
|
|
|
- location: this.location,
|
|
|
|
|
- matchFaceImage: this.tempImg,
|
|
|
|
|
- sceneImage: this.sceneImage,
|
|
|
|
|
|
|
+ fail: () => {
|
|
|
|
|
+ uni.showToast({
|
|
|
|
|
+ title: "上传失败",
|
|
|
|
|
+ icon: 'error'
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
- })
|
|
|
|
|
- // console.log(res);
|
|
|
|
|
- if (res.code == 200) {
|
|
|
|
|
- this.getNowTime()
|
|
|
|
|
- this.$refs.popup.open()
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }, 1000)
|
|
|
|
|
+ },
|
|
|
|
|
+ async handleUploading(imgUrl) {
|
|
|
|
|
+ let res = await this.$myRequest_clockIn({
|
|
|
|
|
+ url: "/attendance/api/sign/check/in/update",
|
|
|
|
|
+ method: "put",
|
|
|
|
|
+ header: {
|
|
|
|
|
+ 'Authorization': uni.getStorageSync("token")
|
|
|
|
|
+ },
|
|
|
|
|
+ data: {
|
|
|
|
|
+ id: this.id,
|
|
|
|
|
+ lat: this.lat,
|
|
|
|
|
+ lng: this.lng,
|
|
|
|
|
+ location: this.location,
|
|
|
|
|
+ matchFaceImage: imgUrl,
|
|
|
|
|
+ sceneImage: this.sceneImage,
|
|
|
}
|
|
}
|
|
|
- }, 2000)
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ // console.log(res);
|
|
|
|
|
+ if (res.code == 200) {
|
|
|
|
|
+ this.getNowTime()
|
|
|
|
|
+ this.$refs.popup.open()
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
// 点击 我知道了按钮 跳回首页
|
|
// 点击 我知道了按钮 跳回首页
|
|
|
handleGoHome() {
|
|
handleGoHome() {
|