| | |
| | | return { |
| | | avatar: __webpack_require__(/*! ../../static/img/touxiang.jpg */ 321), |
| | | formData: {}, |
| | | action: 'http://39.96.92.240:8099/user/updateImg', |
| | | action: 'http://Shuinigonghui.cn:8099/user/updateImg', |
| | | userId: '', |
| | | autoUpload: true }; |
| | | autoUpload: true, |
| | | userInfo: '' }; |
| | | |
| | | }, |
| | | created: function created() { |
| | | console.log("--------created"); |
| | | _this = this; |
| | | // uni.$on('uAvatarCropper', path => { |
| | | // _this.avatar = path; |
| | | // 可以在此上传到服务端 |
| | | // uni.uploadFile({ |
| | | // url: 'http://192.168.100.17/index.php/index/index/upload', |
| | | // filePath: path, |
| | | // name: 'file', |
| | | // complete: (res) => { |
| | | // console.log(res); |
| | | // } |
| | | // }); |
| | | // }) |
| | | }, |
| | | mounted: function mounted() { |
| | | var userInfo = this.getStore('userInfo'); |
| | | this.avatar = userInfo.img; |
| | | this.userInfo = this.getStore('userInfo'); |
| | | this.avatar = this.userInfo.img; |
| | | if (this.avatar == '') { |
| | | this.avatar = '../../static/img/touxiang.jpg'; |
| | | } |
| | | _this.userId = userInfo.id; |
| | | _this.formData.userId = userInfo.id; |
| | | this.userId = this.userInfo.id; |
| | | this.formData.userId = this.userInfo.id; |
| | | }, |
| | | |
| | | methods: { |
| | |
| | | |
| | | }, |
| | | onSuccess: function onSuccess(data, index, lists, name) { |
| | | // this.$refs.upload.remove(0) |
| | | this.$refs.upload.remove(0); |
| | | this.avatar = data.obj.img; |
| | | userInfo.img = data.obj.img; |
| | | this.userInfo.img = data.obj.img; |
| | | // this.setStore("userInfo",data.obj) |
| | | this.$u.toast('修改成功'); |
| | | |