|
@@ -8,15 +8,15 @@
|
|
|
|
|
|
|
|
<view class="h-upload-wrap">
|
|
<view class="h-upload-wrap">
|
|
|
<view class="h-item-row">
|
|
<view class="h-item-row">
|
|
|
- <view @click="uploadImg1(1)" class="h-item">
|
|
|
|
|
- <view v-if="!imgUrl1" class="h-content">
|
|
|
|
|
- <image src="../../static/me/u01.png" mode=""></image>
|
|
|
|
|
|
|
+ <view @click="uploadImg()" class="h-item">
|
|
|
|
|
+ <view v-if="!facePhotoUrl" class="h-content">
|
|
|
|
|
+ <image src="/static/me/u01.png" mode=""></image>
|
|
|
<view class="h-text">
|
|
<view class="h-text">
|
|
|
<text>添加人脸影像</text>
|
|
<text>添加人脸影像</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
<view v-else class="h-upload-img">
|
|
<view v-else class="h-upload-img">
|
|
|
- <image mode="aspectFit" class="imgBox" :src="imgUrl1"></image>
|
|
|
|
|
|
|
+ <image mode="aspectFit" class="imgBox" :src="facePhotoUrl"></image>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
@@ -36,120 +36,37 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ ossId:'',
|
|
|
|
|
+ facePhotoUrl:'',
|
|
|
height:'',
|
|
height:'',
|
|
|
- errShow: false,
|
|
|
|
|
- okShow: false,
|
|
|
|
|
- imgUrl1: '',
|
|
|
|
|
- imgUrl2: '',
|
|
|
|
|
- imgUrl3: '',
|
|
|
|
|
- imgUrl4: '',
|
|
|
|
|
- imgUrl5: '',
|
|
|
|
|
- show: false,
|
|
|
|
|
reqParm: {
|
|
reqParm: {
|
|
|
auth: true,
|
|
auth: true,
|
|
|
facePath: '',
|
|
facePath: '',
|
|
|
businessId: ''
|
|
businessId: ''
|
|
|
},
|
|
},
|
|
|
- userInfo: {
|
|
|
|
|
|
|
+ userInfo: {},
|
|
|
|
|
|
|
|
- },
|
|
|
|
|
- parms: {
|
|
|
|
|
- userName: '',
|
|
|
|
|
- facePhoto: '',
|
|
|
|
|
- facePhotos: '',
|
|
|
|
|
- facePhotoUrl: ''
|
|
|
|
|
- },
|
|
|
|
|
- imgPaths: "",
|
|
|
|
|
- ossImg: {
|
|
|
|
|
- ossId1: "",
|
|
|
|
|
- ossId2: "",
|
|
|
|
|
- ossId3: "",
|
|
|
|
|
- ossId4: "",
|
|
|
|
|
- ossId5: ""
|
|
|
|
|
- },
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onReady() {
|
|
onReady() {
|
|
|
},
|
|
},
|
|
|
onLoad(option) {
|
|
onLoad(option) {
|
|
|
- // 用户信息
|
|
|
|
|
- // let user = this.$store.state.loginUserInfo;
|
|
|
|
|
- // this.userInfo = user;
|
|
|
|
|
|
|
|
|
|
let sysInfo= uni.getSystemInfoSync()
|
|
let sysInfo= uni.getSystemInfoSync()
|
|
|
this.height = sysInfo.screenHeight + 'px'
|
|
this.height = sysInfo.screenHeight + 'px'
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- // 去签订协议
|
|
|
|
|
- gotoAutoLetter(){
|
|
|
|
|
- if(!this.$isDataEmpty(this.parms.userName)){
|
|
|
|
|
- this.okShow = false;
|
|
|
|
|
- uni.$u.route({
|
|
|
|
|
- url: '/pages/me/service-object-all-info',
|
|
|
|
|
- params: {
|
|
|
|
|
- data: JSON.stringify(this.userInfo)
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- // uni.$u.route({
|
|
|
|
|
- // url: '/pages/me/service-object-auth-letter',
|
|
|
|
|
- // params: {
|
|
|
|
|
- // data: JSON.stringify(this.parms)
|
|
|
|
|
- // }
|
|
|
|
|
- // })
|
|
|
|
|
- } else{
|
|
|
|
|
- uni.$u.toast('请认真填写宝贝昵称')
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // 实名认证
|
|
|
|
|
- getoRealNameAuth(){
|
|
|
|
|
- this.errShow = false;
|
|
|
|
|
- // 已认证
|
|
|
|
|
- uni.$u.route({
|
|
|
|
|
- url: '/pages/me/real-name-auth',
|
|
|
|
|
- params: {
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
// 连接已上传的图片地址
|
|
// 连接已上传的图片地址
|
|
|
verifyImgUpload(){
|
|
verifyImgUpload(){
|
|
|
- let img1 = this.ossImg.ossId1;
|
|
|
|
|
- let img2 = this.ossImg.ossId2;
|
|
|
|
|
- let img3 = this.ossImg.ossId3;
|
|
|
|
|
- let img4 = this.ossImg.ossId4;
|
|
|
|
|
- let img5 = this.ossImg.ossId5;
|
|
|
|
|
- if(!img1){
|
|
|
|
|
|
|
+ if(!this.ossId){
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
|
- title: "请上传第1张图片"
|
|
|
|
|
|
|
+ title: "请上传人脸照片"
|
|
|
})
|
|
})
|
|
|
return false;
|
|
return false;
|
|
|
}
|
|
}
|
|
|
- /* if(this.$isDataEmpty(img2)){
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: "请上传第2张图片"
|
|
|
|
|
- })
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- if(this.$isDataEmpty(img3)){
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: "请上传第3张图片"
|
|
|
|
|
- })
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- if(this.$isDataEmpty(img4)){
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: "请上传第4张图片"
|
|
|
|
|
- })
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- if(this.$isDataEmpty(img5)){
|
|
|
|
|
- uni.showToast({
|
|
|
|
|
- title: "请上传第5张图片"
|
|
|
|
|
- })
|
|
|
|
|
- return false;
|
|
|
|
|
- } */
|
|
|
|
|
- // this.parms.facePhotos = img1+","+img2+","+img3+","+img4+","+img5;
|
|
|
|
|
- this.parms.facePhotos = img1;
|
|
|
|
|
return true;
|
|
return true;
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -169,12 +86,12 @@
|
|
|
this.$api.verifyFace(that.reqParm).then((res)=>{
|
|
this.$api.verifyFace(that.reqParm).then((res)=>{
|
|
|
uni.hideLoading();
|
|
uni.hideLoading();
|
|
|
if(res.data.data.code == '500'){ //人脸不存在
|
|
if(res.data.data.code == '500'){ //人脸不存在
|
|
|
- res.facePhotoUrl = that.imgUrl1;
|
|
|
|
|
- res.facePhoto = that.ossImg.ossId1;
|
|
|
|
|
- res.facePhotos = that.parms.facePhotos;
|
|
|
|
|
|
|
+ let serviceObject = {}
|
|
|
|
|
+ serviceObject.facePhoto= this.ossId
|
|
|
|
|
+ serviceObject.facePhotoUrl=this.facePhotoUrl
|
|
|
|
|
+ console.log(JSON.stringify(serviceObject))
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url: '/myPages/serviceObjectAllInfo/index?data'+ JSON.stringify(res),
|
|
|
|
|
-
|
|
|
|
|
|
|
+ url: '/myPages/serviceObjectAllInfo/index?data='+ JSON.stringify(serviceObject),
|
|
|
})
|
|
})
|
|
|
} else { // 人脸存在
|
|
} else { // 人脸存在
|
|
|
res.opType = "1";
|
|
res.opType = "1";
|
|
@@ -192,7 +109,7 @@
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
//头像上传
|
|
//头像上传
|
|
|
- uploadImg1(imgIndex) {
|
|
|
|
|
|
|
+ uploadImg() {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
uni.chooseImage({
|
|
uni.chooseImage({
|
|
|
count: 1,
|
|
count: 1,
|
|
@@ -208,33 +125,9 @@
|
|
|
success: (uploadFileRes) => {
|
|
success: (uploadFileRes) => {
|
|
|
console.log("uploadFileRes:"+uploadFileRes)
|
|
console.log("uploadFileRes:"+uploadFileRes)
|
|
|
let res = JSON.parse(uploadFileRes.data)
|
|
let res = JSON.parse(uploadFileRes.data)
|
|
|
- let ossId = res.data.ossId;
|
|
|
|
|
- let url = res.data.url;
|
|
|
|
|
- let imgUrl = url.startsWith("https")? res.data.url : url.replace("http", "https");
|
|
|
|
|
- console.log("imgUrl:"+imgUrl)
|
|
|
|
|
- if(imgIndex == 1){
|
|
|
|
|
- that.ossImg.ossId1 = ossId;
|
|
|
|
|
- that.parms.facePhotoUrl = imgUrl;
|
|
|
|
|
- that.imgUrl1 = imgUrl;
|
|
|
|
|
- }
|
|
|
|
|
- if(imgIndex == 2){
|
|
|
|
|
- that.ossImg.ossId2 = ossId;
|
|
|
|
|
- that.imgUrl2 = imgUrl;
|
|
|
|
|
- }
|
|
|
|
|
- if(imgIndex == 3){
|
|
|
|
|
- that.ossImg.ossId3 = ossId;
|
|
|
|
|
- that.imgUrl3 = imgUrl;
|
|
|
|
|
- }
|
|
|
|
|
- if(imgIndex == 4){
|
|
|
|
|
- that.ossImg.ossId4 = ossId;
|
|
|
|
|
- that.imgUrl4 = imgUrl;
|
|
|
|
|
- }
|
|
|
|
|
- if(imgIndex == 5){
|
|
|
|
|
- that.ossImg.ossId5 = ossId;
|
|
|
|
|
- that.imgUrl5 = imgUrl;
|
|
|
|
|
- }
|
|
|
|
|
- this.reqParm.facePath = ossId;
|
|
|
|
|
- this.parms.facePhoto = ossId;
|
|
|
|
|
|
|
+ that.ossId = res.data.ossId;
|
|
|
|
|
+ that.facePhotoUrl = res.data.url.replace("http", "https");
|
|
|
|
|
+ that.reqParm.facePath = res.data.ossId;
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|