var that=this
// that.uplodePicture(data.UserFace,1);
that.uplodePicture(data.UserFace, 1) .then(function (res) {
if (res.statusCode == 200) {
that.uplodePicture(data.useRopposite,2)
}
})
uplodePicture: function (options,n){
console.log(options)
console.log(this)
var that=this;
var data=that.data;
var ordinaryId = ‘bc2dd6d’
return new Promise(function (resolve, reject) {
wx.uploadFile({
url: url.uplodeP,
filePath: options,
name: ‘uploadFile’,
formData: {
n:n,
ordinaryId: ordinaryId,
umpireName: data.refreeName,
umpirePhone: data.refreePhone,
umpireINumber: data.refreeID,
umpireRefereeAddress:data.address
//umpireDate:data.dates
},
header: {
“Content-Type”: “multipart/form-data”
},
success:function(res){
console.log(res)
console.log(res.data)
if (res.statusCode == 200) {
resolve(res);
if(n<2){
that.setData({
address: res.data
})
}else if(n==2){
that.setData({
address: ‘’
})
}
}
},
})
})
},