|
@@ -1871,7 +1871,7 @@ export default {
|
|
this.$u.toast("上传成功");
|
|
this.$u.toast("上传成功");
|
|
this.ossAvatarUrl = ossToken.dir;
|
|
this.ossAvatarUrl = ossToken.dir;
|
|
console.log("h5上传成功--:", this.ossAvatarUrl);
|
|
console.log("h5上传成功--:", this.ossAvatarUrl);
|
|
- resolve();
|
|
|
|
|
|
+ resolve(this.ossAvatarUrl);
|
|
},
|
|
},
|
|
fail: (error) => {
|
|
fail: (error) => {
|
|
console.log("h5上传失败:", error);
|
|
console.log("h5上传失败:", error);
|
|
@@ -1905,7 +1905,7 @@ export default {
|
|
// if (result.statusCode === 200) {
|
|
// if (result.statusCode === 200) {
|
|
this.$u.toast("上传成功");
|
|
this.$u.toast("上传成功");
|
|
this.ossAvatarUrl = ossToken.dir;
|
|
this.ossAvatarUrl = ossToken.dir;
|
|
- resolve();
|
|
|
|
|
|
+ resolve(this.ossAvatarUrl);
|
|
// } else {
|
|
// } else {
|
|
// uni.showToast({
|
|
// uni.showToast({
|
|
// title: "上传失败",
|
|
// title: "上传失败",
|
|
@@ -2139,32 +2139,33 @@ export default {
|
|
/**
|
|
/**
|
|
* 人脸匹配
|
|
* 人脸匹配
|
|
*/
|
|
*/
|
|
- faceRecognition() {
|
|
|
|
|
|
+ faceRecognition(url) {
|
|
return new Promise((resolve) => {
|
|
return new Promise((resolve) => {
|
|
- // #ifdef MP-WEIXIN
|
|
|
|
- let fileSystem = uni.getFileSystemManager();
|
|
|
|
- fileSystem.readFile({
|
|
|
|
- filePath: `${this.avatarUrl}`,
|
|
|
|
- encoding: "base64",
|
|
|
|
- position: 0,
|
|
|
|
- success: (res) => {
|
|
|
|
- let base64 = "data:image/jpg;base64," + res.data;
|
|
|
|
|
|
+ // // #ifdef MP-WEIXIN
|
|
|
|
+ // let fileSystem = uni.getFileSystemManager();
|
|
|
|
+ // fileSystem.readFile({
|
|
|
|
+ // filePath: `${this.avatarUrl}`,
|
|
|
|
+ // encoding: "base64",
|
|
|
|
+ // position: 0,
|
|
|
|
+ // success: (res) => {
|
|
|
|
+ // let base64 = "data:image/jpg;base64," + res.data;
|
|
|
|
|
|
- console.log("直播课-base64Data人脸识别参数:", {
|
|
|
|
- imageA: base64,
|
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
|
- gradeId: this.gradeId,
|
|
|
|
- });
|
|
|
|
- this.CompareFace(base64, resolve);
|
|
|
|
- },
|
|
|
|
- fail(err) {
|
|
|
|
- console.error(err, "err");
|
|
|
|
- },
|
|
|
|
- });
|
|
|
|
- // #endif
|
|
|
|
- // #ifdef H5
|
|
|
|
- this.CompareFace(this.faceUrl, resolve);
|
|
|
|
- // #endif
|
|
|
|
|
|
+ // console.log("直播课-base64Data人脸识别参数:", {
|
|
|
|
+ // imageA: base64,
|
|
|
|
+ // orderGoodsId: this.orderGoodsId,
|
|
|
|
+ // gradeId: this.gradeId,
|
|
|
|
+ // });
|
|
|
|
+ // this.CompareFace(base64, resolve);
|
|
|
|
+ // },
|
|
|
|
+ // fail(err) {
|
|
|
|
+ // console.error(err, "err");
|
|
|
|
+ // },
|
|
|
|
+ // });
|
|
|
|
+ // // #endif
|
|
|
|
+ // // #ifdef H5
|
|
|
|
+ // this.CompareFace(this.faceUrl, resolve);
|
|
|
|
+ // // #endif
|
|
|
|
+ this.CompareFace(url, resolve);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
|
|
@@ -2184,7 +2185,8 @@ export default {
|
|
|
|
|
|
this.$api
|
|
this.$api
|
|
.faceCertificationCompareFace({
|
|
.faceCertificationCompareFace({
|
|
- imageA: url,
|
|
|
|
|
|
+ urlA: url,
|
|
|
|
+ // imageA: url,
|
|
orderGoodsId: this.orderGoodsId,
|
|
orderGoodsId: this.orderGoodsId,
|
|
gradeId: this.gradeId,
|
|
gradeId: this.gradeId,
|
|
})
|
|
})
|
|
@@ -2214,11 +2216,10 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.uploadLock = true;
|
|
this.uploadLock = true;
|
|
-
|
|
|
|
- let compareFaceData = await this.faceRecognition();
|
|
|
|
|
|
+ const waitYS = await this.imageInfos();
|
|
|
|
+ let compareFaceData = await this.faceRecognition(waitYS);
|
|
this.compareFaceData = compareFaceData;
|
|
this.compareFaceData = compareFaceData;
|
|
if (compareFaceData >= 80) {
|
|
if (compareFaceData >= 80) {
|
|
- const waitYS = await this.imageInfos();
|
|
|
|
this.postCoursePhotoRecord()
|
|
this.postCoursePhotoRecord()
|
|
.then((res) => {
|
|
.then((res) => {
|
|
this.photoHistoryList.push(this.photoIndex);
|
|
this.photoHistoryList.push(this.photoIndex);
|