Commit 75016146 authored by linwenqing's avatar linwenqing

fix:授权手机号和上传弱网

parent fe844c9d
......@@ -21,15 +21,19 @@ function getPhoto(type, token) {
reject(msg)
})
},
complete: function() {
uni.hideLoading()
},
})
})
}
//上传七牛
function upload(filePath, token) {
console.log('filePath', filePath)
console.log('token', token)
return new Promise((resolve, reject) => {
uni.showLoading({
title: '上传中...',
})
let key =
new Date().getTime() + Math.random(1000) + filePath.split('/').pop() //key为自定义文件名
uni.uploadFile({
......
......@@ -210,6 +210,11 @@ export default {
title: '授权中...',
})
},
inUpload() {
uni.showLoading({
title: '上传中...',
})
},
refleshCode() {
let that = this
this.inGetPhone()
......@@ -247,6 +252,7 @@ export default {
})
},
changeHead() {
this.inUpload()
//更换头像
upload.getPhoto(2, this.qiToken).then((res) => {
this.student.avatarPath = process.uniEnv.qn_asset_url + res.key
......@@ -259,10 +265,14 @@ export default {
...params,
}
getApp().track('changeAvatar', trackParams)
this.$u.api.updateUserInfo(params)
this.inUpload()
this.$u.api.updateUserInfo(params).then(() => {
uni.hideLoading()
})
})
},
changeCertPhoto() {
this.inUpload()
//更换证件头像
upload.getPhoto(2, this.qiToken).then((res) => {
this.student.certificatePhotoPath =
......@@ -276,7 +286,10 @@ export default {
...params,
}
getApp().track('changeCertPhoto', trackParams)
this.$u.api.updateUserInfo(params)
this.inUpload()
this.$u.api.updateUserInfo(params).then(() => {
uni.hideLoading()
})
})
},
userRefuseTip() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment