| | |
| | | // app.ts |
| | | App({ |
| | | globalData: { |
| | | url:'https://qyqjzdd.cdqingyang.gov.cn/qyjz', |
| | | // url:'http://192.168.3.220:8080', |
| | | // url:'https://qyqjzdd.cdqingyang.gov.cn/qyjz', |
| | | url:'http://192.168.3.220:8080', |
| | | // url:'http://221.237.182.28:8443/api', |
| | | imageUrl:'https://qyqjzdd.cdqingyang.gov.cn/minio' |
| | | }, |
| | |
| | | }, |
| | | method: "GET", |
| | | success: (res) => { |
| | | console.log(res); |
| | | // 如果用户已经注册直接进入 未注册进入宣传 role == 0用户 1警员 |
| | | wx.setStorageSync('token', res.data.data.token) |
| | | wx.setStorageSync('role', res.data.data.role) |
| | | wx.setStorageSync('id', res.data.data.id) |
| | |
| | | } else { |
| | | wx.redirectTo( |
| | | { |
| | | url: '../user/loginInfo/index' |
| | | url: '../user/pubulicty/index' |
| | | // url: '../user/loginInfo/index' |
| | | } |
| | | ) |
| | | } |
| | |
| | | |
| | | 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", |
| | |
| | | <view class="lists-content">{{item.text}}</view> |
| | | </view> |
| | | </view> |
| | | |
| | | <view class="buttonView" wx:if="cardFig"> |
| | | <navigator class="button" url="../loginInfo/index">我 要 注 册</navigator> |
| | | </view> |
| | | <!-- <view class="buttonView"> <button class="button" bindtap="register">我 要 注 册</button></view> --> |
| | | |
| | | </view> |
| | |
| | | .container { |
| | | width: 100%; |
| | | } |
| | | |
| | | .buttonView{ |
| | | font-size: 14px; |
| | | position: absolute; |
| | | width: 100%; |
| | | bottom: 5%; |
| | | } |
| | | .button{ |
| | | height: 5vh; |
| | | line-height: 5vh; |
| | | text-align: center; |
| | | left: 0; |
| | | right: 0; |
| | | margin: 0 auto; |
| | | width: 90%; |
| | | margin-top: 60%; |
| | | font-size: 13px; |
| | | color: #6699ff; |
| | | background-color: white; |
| | | border: 1px solid #6699ff; |
| | | } |
| | | .register{ |
| | | position: absolute; |
| | | width: 100%; |
| | | bottom: 12%; |
| | | } |
| | | .content { |
| | | margin-top: 1rem; |
| | | } |