|
@@ -20,6 +20,7 @@ Page({
|
|
|
that.setData({
|
|
|
ditufile: that.data.dtFilePaths
|
|
|
})
|
|
|
+ that.upload(that.data.dtFilePaths,'false')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
@@ -35,14 +36,12 @@ Page({
|
|
|
that.setData({
|
|
|
fengmianfile: that.data.fmFilePaths
|
|
|
})
|
|
|
+ that.upload(that.data.fmFilePaths, 'true')
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
submit:function(){
|
|
|
let that=this
|
|
|
- wx.showLoading({
|
|
|
- title: '正在上传',
|
|
|
- })
|
|
|
if (!that.data.ditufile&&!that.data.fengmianfile){
|
|
|
if (!that.data.dtFilePaths) {
|
|
|
wx.showToast({
|
|
@@ -67,7 +66,8 @@ Page({
|
|
|
that.data.pathscount=0
|
|
|
if (that.data.dtFilePaths){
|
|
|
that.data.pathscount++
|
|
|
- } else if (that.data.fmFilePaths){
|
|
|
+ }
|
|
|
+ if (that.data.fmFilePaths){
|
|
|
that.data.pathscount++
|
|
|
}
|
|
|
if(that.data.dtFilePaths){
|
|
@@ -78,6 +78,9 @@ Page({
|
|
|
}
|
|
|
},
|
|
|
upload: function (file, isShowPhoto){
|
|
|
+ wx.showLoading({
|
|
|
+ title: '正在上传',
|
|
|
+ })
|
|
|
let that=this
|
|
|
wx.uploadFile({
|
|
|
url: api.updateUserHeadImage,
|
|
@@ -92,17 +95,26 @@ Page({
|
|
|
success(res) {
|
|
|
wx.hideLoading()
|
|
|
if (JSON.parse(res.data).youtuMessage.error_code==0){
|
|
|
- if (that.data.pathscount==1){
|
|
|
- wx.redirectTo({
|
|
|
- url: '/pages/success/index',
|
|
|
- })
|
|
|
- }else{
|
|
|
- if (isShowPhoto=='true'){
|
|
|
- wx.redirectTo({
|
|
|
- url: '/pages/success/index',
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+ wx.showToast({
|
|
|
+ title: '上传成功',
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
+ // if (that.data.pathscount==1){
|
|
|
+ // wx.redirectTo({
|
|
|
+ // url: '/pages/success/index',
|
|
|
+ // })
|
|
|
+ // }else{
|
|
|
+ // if (isShowPhoto=='true'){
|
|
|
+ // wx.redirectTo({
|
|
|
+ // url: '/pages/success/index',
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ }else{
|
|
|
+ wx.showToast({
|
|
|
+ title: JSON.parse(res.data).youtuMessage.result.error_msg,
|
|
|
+ icon:'none'
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
})
|