|
@@ -93,18 +93,18 @@ Page({
|
|
|
// avatarUrl,
|
|
|
// })
|
|
|
// },
|
|
|
- onChooseAvatar1(){
|
|
|
- chooseImage().then((res)=>{
|
|
|
- this.uploadImage(res.tempFilePaths[0]);
|
|
|
- })
|
|
|
- },
|
|
|
- uploadImage(imagePath){
|
|
|
- upLoad( imagePath ).then((res) => {
|
|
|
+ onChooseAvatar(e){
|
|
|
+ const {avatarUrl} = e.detail;
|
|
|
+ console.log(avatarUrl);
|
|
|
+ upLoad( avatarUrl ).then((res) => {
|
|
|
console.log(res);
|
|
|
this.setData({
|
|
|
avatarUrl: res.Url
|
|
|
});
|
|
|
wx.setStorageSync('avatarUrl', res.Url);
|
|
|
+ this.setData({
|
|
|
+ avatarUrl,
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
onInputUsername:function(e){
|