赞
踩
- <button class="name2" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
- <image :src="headimg" mode=""></image>
- </button>
方法:
- onChooseAvatar (e) {
- this.headimg = e.detail.avatarUrl; //图片生成的本地地址
- console.log(this.headimg, '头像变化');
- let imgPath = this.headimg
- uploadImage(图片生成的本地地址, '上传服务器的地址',
- result => {
- this.heading=result// 返回图片的网络地址
- console.log(result);
- },
- failc => {
- console.log(failc, 'failc')
- })
- },