| | |
| | | |
| | | Page({ |
| | | data: { |
| | | isShowImg:false, |
| | | pic:'', |
| | | picUrl:'', |
| | | reportList:{}, |
| | | }, |
| | | face(){ |
| | | console.log(this.data.reportList.pic); |
| | | |
| | | wx.previewMedia({ |
| | | sources:[{url:this.data.reportList.pic}] |
| | | }) |
| | | }, |
| | | subImg(){ |
| | | wx.request( |
| | | { |
| | | url:userDetailMyself.globalData.url+ "/wx/user/add", |
| | | method:"POST", |
| | | data:{ |
| | | id:wx.getStorageSync('id'), |
| | | pic:this.data.pic |
| | | }, |
| | | header:{'token':wx.getStorageSync('token')}, |
| | | success:(res)=>{ |
| | | console.log(res) |
| | | this.data.reportList.pic= this.data.picUrl |
| | | this.setData({ |
| | | isShowImg:false |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | faces(){ |
| | | wx.chooseMedia({ |
| | | count:1, |
| | | mediaType:['image'], |
| | | sourceType:['camera'], |
| | | camera:"front", |
| | | success:(res)=>{ |
| | | wx.uploadFile({ |
| | | url: userDetailMyself.globalData.url+"/minio/upload", |
| | | filePath: res.tempFiles[0].tempFilePath, |
| | | name: "file", |
| | | header: { |
| | | // 'token': wx.getStorageSync('token'), |
| | | 'content-type': 'application/json' |
| | | }, |
| | | success:(res)=>{ |
| | | // // 成功通知 |
| | | // Notify({ type: 'primary', message: '采集成功' }); |
| | | const result = JSON.parse(res.data) |
| | | this.setData({ |
| | | pic:result.data, |
| | | picUrl:userDetailMyself.globalData.imageUrl+'/img/'+result.data, |
| | | isShowImg:true |
| | | }) |
| | | this.subImg() |
| | | console.log(this.data.pic,this.data.picUrl); |
| | | |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | onLoad() { |
| | |
| | | res.data.data.pic=userDetailMyself.globalData.imageUrl+"/img/"+res.data.data.pic |
| | | } |
| | | this.setData({ |
| | | reportList:res.data.data |
| | | reportList:res.data.data, |
| | | picUrl:res.data.data.pic |
| | | }) |
| | | console.log(this.data.picUrl); |
| | | |
| | | } |
| | | }) |
| | | } |