|
@@ -67,7 +67,7 @@ Page({
|
|
formData.idnoimg_back = this.data.idnoimg_back
|
|
formData.idnoimg_back = this.data.idnoimg_back
|
|
formData.halfbody_img = this.data.halfbody_img
|
|
formData.halfbody_img = this.data.halfbody_img
|
|
formData.education_img = this.data.education_img
|
|
formData.education_img = this.data.education_img
|
|
- if (formData.idnoimg_face == '') {
|
|
|
|
|
|
+ if (!formData.idnoimg_face) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '正面照不存在!',
|
|
title: '正面照不存在!',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -75,7 +75,7 @@ Page({
|
|
})
|
|
})
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- if (formData.idnoimg_back == '') {
|
|
|
|
|
|
+ if (!formData.idnoimg_back) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '反面照不存在!',
|
|
title: '反面照不存在!',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -83,7 +83,7 @@ Page({
|
|
})
|
|
})
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- if (formData.halfbody_img == '') {
|
|
|
|
|
|
+ if (!formData.halfbody_img) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '半身照不存在!',
|
|
title: '半身照不存在!',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -91,7 +91,7 @@ Page({
|
|
})
|
|
})
|
|
return false
|
|
return false
|
|
}
|
|
}
|
|
- if (formData.education_img == '') {
|
|
|
|
|
|
+ if (!formData.education_img) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '学历照不存在!',
|
|
title: '学历照不存在!',
|
|
icon: 'none',
|
|
icon: 'none',
|
|
@@ -146,15 +146,12 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
takePhoto:function(e){
|
|
takePhoto:function(e){
|
|
- let id=e.target.dataset.id
|
|
|
|
|
|
+ var id=e.target.dataset.id
|
|
var _this=this
|
|
var _this=this
|
|
wx.chooseImage({
|
|
wx.chooseImage({
|
|
count:1,
|
|
count:1,
|
|
success: function(res) {
|
|
success: function(res) {
|
|
- console.log(res.tempFilePaths[0])
|
|
|
|
- wx.showLoading({
|
|
|
|
- title: '',
|
|
|
|
- })
|
|
|
|
|
|
+
|
|
wx.uploadFile({
|
|
wx.uploadFile({
|
|
url: host+'/api/wx/uploadfile',
|
|
url: host+'/api/wx/uploadfile',
|
|
filePath: res.tempFilePaths[0],
|
|
filePath: res.tempFilePaths[0],
|
|
@@ -165,7 +162,11 @@ Page({
|
|
success:res=>{
|
|
success:res=>{
|
|
wx.hideLoading()
|
|
wx.hideLoading()
|
|
var data=JSON.parse(res.data)
|
|
var data=JSON.parse(res.data)
|
|
- console.log(data)
|
|
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '上传成功' + data.data.url,
|
|
|
|
+ icon: 'none',
|
|
|
|
+ duration: 2000
|
|
|
|
+ })
|
|
if(id == 1){ //正面
|
|
if(id == 1){ //正面
|
|
_this.setData({
|
|
_this.setData({
|
|
idnoimg_face: data.data.url
|
|
idnoimg_face: data.data.url
|
|
@@ -194,8 +195,9 @@ Page({
|
|
},
|
|
},
|
|
fail: res => {
|
|
fail: res => {
|
|
wx.hideLoading()
|
|
wx.hideLoading()
|
|
|
|
+ wx.hideLoading()
|
|
wx.showToast({
|
|
wx.showToast({
|
|
- title: res.data.message,
|
|
|
|
|
|
+ title: res,
|
|
icon: 'none',
|
|
icon: 'none',
|
|
duration: 2000
|
|
duration: 2000
|
|
})
|
|
})
|