| | |
| | | |
| | | Page({ |
| | | data: { |
| | | cardFig:true, |
| | | swcurrent: 0, |
| | | causeList: [], |
| | | isShow: false |
| | | }, |
| | | register(e){ |
| | | console.log(e); |
| | | |
| | | }, |
| | | getMobile(){ |
| | | // 获取手机号 |
| | | wx.request( |
| | | { |
| | | url:userCause.globalData.url+ "/wx/user/myself", |
| | | method:"GET", |
| | | data:{ |
| | | id:wx.getStorageSync('id') |
| | | }, |
| | | header:{'token':wx.getStorageSync('token')}, |
| | | success:(res)=>{ |
| | | console.log(res) |
| | | if (res.data.data.userMobile) { |
| | | this.getUserRegister(res.data.data.userMobile) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | // 通过手机号查询是否是已注册用户 |
| | | getUserRegister(phone){ |
| | | wx.request( |
| | | { |
| | | url:userCause.globalData.url+ "/wx/isExist", |
| | | method:"GET", |
| | | data:{ |
| | | phone:phone |
| | | }, |
| | | header:{'token':wx.getStorageSync('token')}, |
| | | success:(res)=>{ |
| | | console.log(res) |
| | | |
| | | } |
| | | }) |
| | | }, |
| | | // 事件处理函数 |
| | | onLoad() { |
| | | this.getMobile() |
| | | let info=wx.getStorageSync('card') |
| | | console.log(info); |
| | | |
| | | if (info) { |
| | | this.setData({ |
| | | cardFig :false |
| | | }) |
| | | }else{ |
| | | this.setData({ |
| | | cardFig :true |
| | | }) |
| | | } |
| | | wx.request( |
| | | { |
| | | url: userCause.globalData.url + "/wx/publicity", |