| | |
| | | console.log("code", res.code) |
| | | wx.setStorageSync('uesrCode', res.code) |
| | | wx.setStorageSync('userPhoneNumberCode',e.detail.code) |
| | | |
| | | |
| | | wx.request({ |
| | | url:app.globalData.url+"/wx/checkIdentity", |
| | | data: { |
| | |
| | | method: "GET", |
| | | success:(res)=>{ |
| | | console.log(res); |
| | | wx.setStorageSync('phone', res.data.msg) |
| | | if (res.data.data==0) { |
| | | wx.redirectTo( |
| | | { |
| | |
| | | |
| | | |
| | | onLoad() { |
| | | wx.request({ |
| | | url: user.globalData.url+"/wx/login", |
| | | data: { |
| | | "phone": wx.getStorageSync('phone'), |
| | | }, |
| | | method: "GET", |
| | | success: (res) => { |
| | | console.log(res); |
| | | wx.setStorageSync('token', res.data.data.token) |
| | | wx.setStorageSync('role', res.data.data.role) |
| | | wx.setStorageSync('id', res.data.data.id) |
| | | wx.setStorageSync('card',res.data.data.time) |
| | | |
| | | wx.request( |
| | | { |
| | | url: user.globalData.url + "/wx/publicity?size=" + "4", |
| | | method: "GET", |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | |
| | | res.data.data.map(i => { |
| | | if (i.photoStr != null) { |
| | | i.photoStr = i.photoStr.split(",").map(i => user.globalData.imageUrl + "/img/" + i), |
| | | this.data.images = i.photoStr |
| | | } |
| | | }) |
| | | this.setData({ |
| | | causeList: res.data.data, |
| | | }) |
| | | |
| | | |
| | | } |
| | | }) |
| | | }}) |
| | | if (wx.getStorageSync('info') == '') { |
| | | wx.redirectTo({ |
| | | url: '../user/loginInfo/index' |
| | | }) |
| | | } |
| | | wx.request( |
| | | { |
| | | url: user.globalData.url + "/wx/publicity?size=" + "4", |
| | | method: "GET", |
| | | header: { 'token': wx.getStorageSync('token') }, |
| | | success: (res) => { |
| | | |
| | | res.data.data.map(i => { |
| | | if (i.photoStr != null) { |
| | | i.photoStr = i.photoStr.split(",").map(i => user.globalData.imageUrl + "/img/" + i), |
| | | this.data.images = i.photoStr |
| | | } |
| | | }) |
| | | this.setData({ |
| | | causeList: res.data.data, |
| | | }) |
| | | |
| | | |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | getReport() { |
| | | console.log("xxx") |
| | |
| | | } |
| | | this.data.user.userIdcard=e.detail.value |
| | | }, |
| | | getPhoneNumber:function(e){ |
| | | console.log(e); |
| | | |
| | | }, |
| | | submit(){ |
| | | if(!/^[\u4e00-\u9fa5]{2,4}$/.test(this.data.user.realName)){ |
| | | // Toast.fail('请输入正确的姓名'); |
| | |
| | | return |
| | | } |
| | | wx.request({ |
| | | |
| | | url: loginInfo.globalData.url+"/wx/login", |
| | | data: { |
| | | "code": wx.getStorageSync('uesrCode'), |
| | | "phoneNumberCode": wx.getStorageSync('userPhoneNumberCode') |
| | | "phone": wx.getStorageSync('phone'), |
| | | }, |
| | | method: "GET", |
| | | success: (res) => { |
| | |
| | | wx.setStorageSync('id', res.data.data.id) |
| | | wx.setStorageSync('card',res.data.data.time) |
| | | console.log(res.data.data.id) |
| | | this.data.user.id= res.data.data.id |
| | | wx.setStorageSync('id',res.data.data.id) |
| | | wx.request({ |
| | | url:loginInfo.globalData.url+"/wx/user/add", |
| | | method:"POST", |
| | | data:this.data.user, |
| | | header:{ |
| | | 'token':wx.getStorageSync('token') |
| | | }, |
| | | success:(res)=>{ |
| | | wx.setStorageSync('info',true) |
| | | wx.reLaunch({ |
| | | url:'../../user/index' |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | wx.request({ |
| | | url:loginInfo.globalData.url+"/wx/user/add", |
| | | method:"POST", |
| | | data:this.data.user, |
| | | header:{ |
| | | 'token':wx.getStorageSync('token') |
| | | }, |
| | | success:(res)=>{ |
| | | wx.setStorageSync('info',true) |
| | | wx.reLaunch({ |
| | | url:'../../user/index' |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | face(){ |
| | | wx.chooseMedia({ |
| | |
| | | }, |
| | | // 事件处理函数 |
| | | onLoad() { |
| | | if (wx.getStorageSync('token')) { |
| | | this.setData({ |
| | | cardFig:false |
| | | }) |
| | | } |
| | | // this.getMobile() |
| | | // let info=wx.getStorageSync('card') |
| | | // console.log(info); |
| | |
| | | <view class="lists-content">{{item.text}}</view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="buttonView" wx:if="cardFig"> |
| | | <view class="buttonView" wx:if="{{cardFig}}"> |
| | | <navigator class="button" url="../loginInfo/index">我 要 注 册</navigator> |
| | | </view> |
| | | <!-- <view class="buttonView"> <button class="button" bindtap="register">我 要 注 册</button></view> --> |
| | |
| | | /**index.wxss**/ |
| | | .icon { |
| | | height: 90%; |
| | | height: 40rem; |
| | | overflow: auto; |
| | | } |
| | | |
| | | .font-wenzi { |
| | |
| | | // index.ts |
| | | const submitReport =getApp() |
| | | import Toast from '@vant/weapp/toast/toast'; |
| | | Page({ |
| | | data: { |
| | | beforList:'a', |
| | | amountInvolved:'', |
| | | workingLocation:'', |
| | | Location:'', |
| | | userIdCard:'', |
| | | sex:'男', |
| | | realName:'', |
| | | phone:wx.getStorageSync('phone'), |
| | | fileImgList: [], |
| | | transactionReceiptList:[], |
| | | otherList:[], |
| | | causeIndex: null, |
| | | items: { name: '日期时间选择', value: 'dateTime' }, |
| | | mode: 'dateTime', |
| | | reportDetail: {}, |
| | | causeList: [], |
| | | imagesFile: [], |
| | | cardIdList:[], |
| | | images: [], |
| | | materials:"", |
| | | materials:'', |
| | | cheatTime:"", |
| | | arraySex: [ |
| | | {sex:'男',id:1}, |
| | |
| | | ], |
| | | sexId:0 |
| | | }, |
| | | afterReadImg(event: { detail: { file: any; }; }){ |
| | | getrealName(e){ |
| | | this.setData({ |
| | | realName:e.detail |
| | | }) |
| | | }, |
| | | getsex(e){ |
| | | this.setData({ |
| | | sex:e.detail |
| | | }) |
| | | }, |
| | | getuserIdCard(e){ |
| | | this.setData({ |
| | | userIdCard:e.detail |
| | | }) |
| | | }, |
| | | getLocation(e){ |
| | | this.setData({ |
| | | Location:e.detail |
| | | }) |
| | | }, |
| | | getworkingLocation(e){ |
| | | this.setData({ |
| | | workingLocation:e.detail |
| | | }) |
| | | }, |
| | | getamountInvolved(e){ |
| | | this.setData({ |
| | | amountInvolved:e.detail |
| | | }) |
| | | }, |
| | | onChangeTabs(e){ |
| | | this.setData({ |
| | | beforList:e.detail.name |
| | | }) |
| | | }, |
| | | afterReadImg(event: { detail: { file: any; }; },name){ |
| | | console.log(event,name); |
| | | |
| | | const { file } = event.detail; |
| | | let that=this |
| | | console.log(file); |
| | |
| | | success(res) { |
| | | // 上传完成需要更新 fileList |
| | | const { fileImgList = [] } = that.data; |
| | | fileImgList.push({ ...file, url: res.data }); |
| | | that.setData({ fileImgList }); |
| | | |
| | | |
| | | const result = JSON.parse(res.data) |
| | | const { transactionReceiptList = [] } = that.data; |
| | | const { otherList = [] } = that.data; |
| | | const { cardIdList = [] } = that.data; |
| | | let result = JSON.parse(res.data) |
| | | if (that.data.beforList=='a') { |
| | | cardIdList.push({ ...file, url: res.data }); |
| | | that.setData({ cardIdList }); |
| | | }else if(that.data.beforList=='b'){ |
| | | fileImgList.push({ ...file, url: res.data }); |
| | | that.setData({ fileImgList }); |
| | | }else if(that.data.beforList=='c'){ |
| | | transactionReceiptList.push({ ...file, url: res.data }); |
| | | that.setData({ transactionReceiptList }); |
| | | }else if(that.data.beforList=='d'){ |
| | | otherList.push({ ...file, url: res.data }); |
| | | that.setData({ otherList }); |
| | | } |
| | | |
| | | |
| | | that.setData({ |
| | | materials: that.data.materials+=result.data+"," |
| | |
| | | this.setData({ |
| | | sexId:e.detail.value |
| | | }) |
| | | this.setData({ |
| | | sex:this.data.arraySex[e.detail.value].sex |
| | | }) |
| | | }, |
| | | getMoney:function(e){ |
| | | console.log(e.detail.value) |
| | |
| | | }) |
| | | }, |
| | | pass() { |
| | | console.log(this.data.realName); |
| | | if (this.data.realName=='') { |
| | | Toast('请输入姓名!'); |
| | | return |
| | | } else if(this.data.userIdCard=='') { |
| | | Toast('请输入身份证!'); |
| | | return |
| | | }else if(this.data.Location=='') { |
| | | Toast('请输入现住址!'); |
| | | return |
| | | }else if(this.data.workingLocation=='') { |
| | | Toast('请输入工作单位!'); |
| | | return |
| | | }else if(this.data.amountInvolved=='') { |
| | | Toast('请输入受损金额!'); |
| | | return |
| | | }else if(this.data.cardIdList.length!=2) { |
| | | Toast('请选择身份证照片!'); |
| | | return |
| | | } |
| | | if (this.data.fileImgList.length!=0||this.data.transactionReceiptList.length!=0||this.data.otherList.length!=0) { |
| | | |
| | | }else{ |
| | | |
| | | Toast('相关合同,交易凭证,其他;必填一项!'); |
| | | return |
| | | } |
| | | this.data.materials=this.data.materials.substring(0,this.data.materials.length-1); |
| | | this.data.reportDetail.amountInvolved=this.data.amountInvolved, |
| | | this.data.reportDetail.workingLocation=this.data.workingLocation, |
| | | this.data.reportDetail.Location=this.data.Location, |
| | | this.data.reportDetail.userIdCard=this.data.userIdCard, |
| | | this.data.reportDetail.sex=this.data.sex, |
| | | this.data.reportDetail.realName=this.data.realName, |
| | | this.data.reportDetail.phone=this.data.phone, |
| | | this.data.reportDetail.reportMaterials=this.data.materials |
| | | this.data.reportDetail.userId=wx.getStorageSync('id') |
| | | this.data.reportDetail.cheatTime=this.data.cheatTime |
| | |
| | | </view> |
| | | <van-cell-group> |
| | | <van-field |
| | | required |
| | | value="{{ getMoney }}" |
| | | bind:input="getrealName" |
| | | required |
| | | value="{{ realName }}" |
| | | label="姓名" |
| | | placeholder="请输入姓名" |
| | | /> |
| | | <van-field |
| | | <!-- <van-field |
| | | bind:input="getsex" |
| | | required |
| | | value="{{ getMoney }}" |
| | | value="{{ sex }}" |
| | | label="性别" |
| | | placeholder="请输入姓名" |
| | | /> |
| | | <!-- <view class="listSex"> |
| | | /> --> |
| | | <view class="listSex"> |
| | | <view > <span class="list-sure">*</span>性别</view> |
| | | <picker bindchange="bindPickerChangeSex" value="{{sexId}}" range="{{arraySex}}" range-key="sex" > |
| | | <view class="picker"> |
| | | 当前选择:{{arraySex[sexId].sex}} |
| | | </view> |
| | | </picker> --> |
| | | <!-- </view> --> |
| | | </picker> |
| | | </view> |
| | | |
| | | <van-field |
| | | bind:input="getuserIdCard" |
| | | required |
| | | value="{{ phone }}" |
| | | value="{{ userIdCard }}" |
| | | label="身份证" |
| | | placeholder="请输入身份证" |
| | | /> |
| | | <van-field |
| | | disabled |
| | | required |
| | | value="{{ phone }}" |
| | | label="联系电话" |
| | |
| | | |
| | | /> |
| | | <van-field |
| | | bind:input="getLocation" |
| | | required |
| | | value="{{ phone }}" |
| | | value="{{ Location }}" |
| | | label="现住址" |
| | | placeholder="请输入现住址" |
| | | |
| | | /> |
| | | <van-field |
| | | bind:input="getworkingLocation" |
| | | required |
| | | value="{{ phone }}" |
| | | value="{{ workingLocation }}" |
| | | label="工作单位" |
| | | placeholder="请输入工作单位" |
| | | |
| | |
| | | |
| | | </view> |
| | | <van-field |
| | | bind:input="getamountInvolved" |
| | | required |
| | | value="{{ phone }}" |
| | | value="{{ amountInvolved }}" |
| | | label="受损金额" |
| | | placeholder="请输入受损金额" |
| | | /> |
| | | <van-field |
| | | required |
| | | readonly |
| | | value="{{ phone }}" |
| | | value="{{ }}" |
| | | label="作证材料" |
| | | placeholder=" " |
| | | > |
| | | |
| | | </van-field> |
| | | <van-notice-bar |
| | | mode="closeable" |
| | | left-icon="volume-o" |
| | | text="身份证正反必填,相关合同,交易凭证,其他;三个必须要填写一个" |
| | | |
| | | /> |
| | | <van-tabs active="a" ellipsis="{{false}}"> |
| | | <van-tab title="身份证正反面" name="a"> |
| | | <view class="upload" bindtap="uploadImage"> |
| | | <!-- <view class="upload" bindtap="uploadImage"> |
| | | <image class="imageUp" src="../../../icon/Photograph.png"></image> |
| | | <view class="upload-wenzi">拍摄身份证照片</view> |
| | | </view> |
| | | <view class="imagess" wx:for="{{images}}" wx:key="index"> |
| | | <image class="image" style="width: 100%;" src="{{item.url}}" mode="aspectFill"></image> |
| | | </view> |
| | | </view> --> |
| | | <van-tabs active="a" ellipsis="{{false}}" bind:change="onChangeTabs"> |
| | | <van-tab title="身份证正反面" name="a"> |
| | | <van-uploader |
| | | file-list="{{ cardIdList }}" |
| | | max-count="2" |
| | | bind:after-read="afterReadImg" |
| | | capture="camera" |
| | | accept="image/*" |
| | | /> |
| | | |
| | | </van-tab> |
| | | <van-tab title="相关合同" name="b"> |
| | | <van-uploader |
| | | file-list="{{ fileImgList }}" |
| | | max-count="2" |
| | | bind:after-read="afterReadImg" |
| | | /> |
| | | </van-tab> |
| | | <van-tab title="交易凭证" name="c">内容 3</van-tab> |
| | | <van-tab title="其他" name="d">内容 4</van-tab> |
| | | <van-tab title="交易凭证" name="c"> |
| | | <van-uploader |
| | | file-list="{{ transactionReceiptList }}" |
| | | bind:after-read="afterReadImg" |
| | | /> |
| | | </van-tab> |
| | | <van-tab title="其他" name="d"> |
| | | <van-uploader |
| | | file-list="{{ otherList }}" |
| | | bind:after-read="afterReadImg" |
| | | /> |
| | | </van-tab> |
| | | </van-tabs> |
| | | </van-cell-group> |
| | | |
| | |
| | | <button class="button2" size="mini" bindtap="pass">提交</button> |
| | | <button class="button1" size="mini" bindtap="cancel">取消</button> |
| | | </view> |
| | | <van-toast id="van-toast" /> |
| | | </view> |