Commit 75016146 authored by linwenqing's avatar linwenqing

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

parent fe844c9d
...@@ -21,15 +21,19 @@ function getPhoto(type, token) { ...@@ -21,15 +21,19 @@ function getPhoto(type, token) {
reject(msg) reject(msg)
}) })
}, },
complete: function() {
uni.hideLoading()
},
}) })
}) })
} }
//上传七牛 //上传七牛
function upload(filePath, token) { function upload(filePath, token) {
console.log('filePath', filePath)
console.log('token', token)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.showLoading({
title: '上传中...',
})
let key = let key =
new Date().getTime() + Math.random(1000) + filePath.split('/').pop() //key为自定义文件名 new Date().getTime() + Math.random(1000) + filePath.split('/').pop() //key为自定义文件名
uni.uploadFile({ uni.uploadFile({
......
...@@ -210,6 +210,11 @@ export default { ...@@ -210,6 +210,11 @@ export default {
title: '授权中...', title: '授权中...',
}) })
}, },
inUpload() {
uni.showLoading({
title: '上传中...',
})
},
refleshCode() { refleshCode() {
let that = this let that = this
this.inGetPhone() this.inGetPhone()
...@@ -247,6 +252,7 @@ export default { ...@@ -247,6 +252,7 @@ export default {
}) })
}, },
changeHead() { changeHead() {
this.inUpload()
//更换头像 //更换头像
upload.getPhoto(2, this.qiToken).then((res) => { upload.getPhoto(2, this.qiToken).then((res) => {
this.student.avatarPath = process.uniEnv.qn_asset_url + res.key this.student.avatarPath = process.uniEnv.qn_asset_url + res.key
...@@ -259,10 +265,14 @@ export default { ...@@ -259,10 +265,14 @@ export default {
...params, ...params,
} }
getApp().track('changeAvatar', trackParams) getApp().track('changeAvatar', trackParams)
this.$u.api.updateUserInfo(params) this.inUpload()
this.$u.api.updateUserInfo(params).then(() => {
uni.hideLoading()
})
}) })
}, },
changeCertPhoto() { changeCertPhoto() {
this.inUpload()
//更换证件头像 //更换证件头像
upload.getPhoto(2, this.qiToken).then((res) => { upload.getPhoto(2, this.qiToken).then((res) => {
this.student.certificatePhotoPath = this.student.certificatePhotoPath =
...@@ -276,7 +286,10 @@ export default { ...@@ -276,7 +286,10 @@ export default {
...params, ...params,
} }
getApp().track('changeCertPhoto', trackParams) getApp().track('changeCertPhoto', trackParams)
this.$u.api.updateUserInfo(params) this.inUpload()
this.$u.api.updateUserInfo(params).then(() => {
uni.hideLoading()
})
}) })
}, },
userRefuseTip() { 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