| | |
| | | 'content-type': 'application/json' |
| | | }, |
| | | success:(res)=>{ |
| | | // 成功通知 |
| | | Notify({ type: 'primary', message: '采集成功' }); |
| | | const result = JSON.parse(res.data) |
| | | this.setData({ |
| | | pic:result.data, |
| | | isShow:true |
| | | }) |
| | | // 成功通知 |
| | | Notify({ type: 'primary', message: '采集成功' }); |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | 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); |
| | | |
| | | } |
| | | }) |
| | | } |
| | |
| | | |
| | | </view> |
| | | <view class="list1"> |
| | | <view class="foot"> |
| | | <view class="font-wenzi">头像采集</view> |
| | | <view wx:if="{{reportList.pic==null||reportList.pic==''}}" class="content headPortrait" bindtap="face">未上传</view> |
| | | <view wx:else="{{reportList.pic!=null}}" class="content headPortrait" bindtap="face">查看</view> |
| | | |
| | | <!-- <view wx:else="{{reportList.pic!=null}}" class="content headPortrait" bindtap="face">查看</view> --> |
| | | </view> |
| | | <view wx:if="{{reportList.pic==null||reportList.pic==''}}" class="content headPortrait" bindtap="face">未上传</view> |
| | | <view wx:if="{{!isShowImg}}" > |
| | | <van-image bind:click="faces" width="100" height="100" src="{{picUrl}}" /> |
| | | </view> |
| | | <view wx:if="{{isShowImg}}" > |
| | | <van-image bind:click="faces" width="100" height="100" src="{{picUrl}}" /> |
| | | </view> |
| | | <!-- <button class="foot-button" size="mini" bindtap="faces">点击修改头像</button> --> |
| | | </view> |
| | | |
| | | |
| | | <!-- <view class="buttonView"> |
| | | <button class="button-sub" size="mini" bindtap="subImg">提 交</button> |
| | | </view> --> |
| | | |
| | | <!-- <view class="list1"> |
| | | <view class="content">{{causeDetail.cop}}</view> |
| | | <view class="font-wenzi">负责民警</view> |
| | |
| | | /**index.wxss**/ |
| | | .buttonView{ |
| | | margin-top: 1rem; |
| | | font-size: 14px; |
| | | text-align: center; |
| | | width: 100%; |
| | | margin-bottom: 1rem; |
| | | } |
| | | .button-sub{ |
| | | |
| | | height: 5vh; |
| | | line-height: 5vh; |
| | | text-align: center; |
| | | left: 0; |
| | | right: 0; |
| | | margin: 0 auto; |
| | | width: 90%; |
| | | font-size: 13px; |
| | | color: #6699ff; |
| | | background-color: white; |
| | | border: 1px solid #6699ff; |
| | | } |
| | | .isshow-img{ |
| | | margin-top: 1rem; |
| | | } |
| | | .foot{ |
| | | display: flex; |
| | | } |
| | | .title{ |
| | | margin-top: 1rem; |
| | | font-size: 18px; |
| | |
| | | margin-right: 0.6rem; |
| | | font-weight: 700; |
| | | } |
| | | .foot-button{ |
| | | margin: 0; |
| | | } |
| | | .list1{ |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-left: 0.6rem; |
| | | margin-right: 0.6rem; |
| | | display: flex; |
| | |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | let imgs = [] |
| | | if (res.data.data.idCardMaterials != '') { |
| | | if (res.data.data.idCardMaterials) { |
| | | imgs.push(...res.data.data.idCardMaterials.split(",")) |
| | | if (res.data.data.contractMaterials != '') { |
| | | if (res.data.data.contractMaterials) { |
| | | imgs.push(...res.data.data.contractMaterials.split(",")) |
| | | if (res.data.data.transactionMaterials != '') { |
| | | if (res.data.data.transactionMaterials) { |
| | | imgs.push(...res.data.data.transactionMaterials.split(",")) |
| | | if (res.data.data.elseMaterials != '') { |
| | | if (res.data.data.elseMaterials) { |
| | | imgs.push(...res.data.data.elseMaterials.split(",")) |
| | | } |
| | | } |