| | |
| | | |
| | | isShowPwd:false,//是否显示密码 |
| | | }, |
| | | |
| | | //获取缓存中的用户信息 |
| | | getStorageUserInfo(){ |
| | | if(!wx.getStorageSync('AccountInfo'))return |
| | | let userInfo = JSON.parse(wx.getStorageSync('AccountInfo')) || {} |
| | | if(!userInfo)return |
| | | this.setData({ |
| | | phone:userInfo.access_info.account, |
| | | password:userInfo.access_info.password |
| | | }) |
| | | }, |
| | | // 打电话 |
| | | call: function () { |
| | | wx.makePhoneCall({ |
| | |
| | | if(Token){ |
| | | isNeedToken = true |
| | | } |
| | | |
| | | let ExpreTime = new Date().getTime() //获取当前时间戳 |
| | | let access_info = { |
| | | account:that.data.phone, |
| | | password:that.data.password |
| | | } |
| | | // 账户信息 |
| | | let userAccountInfo = { |
| | | access_info:access_info |
| | | } |
| | | |
| | | wx.setStorageSync('AccessToken', { |
| | | Token:Token, |
| | | ExpreTime:ExpreTime, |
| | | isNeedToken:isNeedToken |
| | | }) |
| | | |
| | | wx.setStorageSync( "AccountInfo",JSON.stringify(userAccountInfo)) |
| | | var return_user = return_data.User; |
| | | //console.log(return_user); |
| | | |
| | |
| | | //登录成功 |
| | | loginSuccessCb: function (userInfo) { |
| | | var that = this; |
| | | console.log(userInfo,184) |
| | | that.setData({ |
| | | userInfo: userInfo |
| | | }); |
| | |
| | | inputWidth: screenWidth, |
| | | inputHeight: screenHightScale * 177 |
| | | }); |
| | | |
| | | this.getStorageUserInfo() |
| | | }, |
| | | |
| | | onShareAppMessage: function () { |
| | |
| | | var result = res.data.Data |
| | | if (res.data.Code != 0) { |
| | | wx.showToast({ |
| | | title: '数据加载失败', |
| | | title: '当前月份暂无报表数据', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }) |
| | |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }) |
| | | // console.log(err) |
| | | console.log(err) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | //return |
| | | if (res.data.Code != 0) { |
| | | wx.showToast({ |
| | | title: '数据加载失败', |
| | | title: '当前月份暂无报表数据', |
| | | icon: 'none', |
| | | duration: 2000 |
| | | }) |
| | |
| | | const Request = function(params){ |
| | | console.log(params,2) |
| | | let tokenInfo = wx.getStorageSync('AccessToken') |
| | | // console.log(tokenInfo,3) |
| | | let currentDateTime = new Date().getTime() |