// pages/usercenter/usercenter.js import bindLog,{logs} from "../../module/logs/logs" import stylemap from "../../common/stylemap" import share from "../../common/share" var app = getApp(); Page(Object.assign({ /** * 页面的初始数据 */ data: { windowh: app.globalData.windowh }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { bindLog(this); try{ var number = wx.getStorageSync("mobile"); }catch(e){ } if(!number){ this.openLog(); }else{ this.getPhone(number); } this.setData(stylemap); }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面显示 */ onShow: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { }, checkLogin:function(){ try{ var number = wx.getStorageSync("mobile"); }catch(e){ } if(!number){ this.openLog(); } }, getPhone:function(number){ var numbers = number.split(""); numbers.splice(3,4,"****"); number = numbers.join(""); this.setData({phonenumber:number}); }, closeLogBack:function(){ var number = wx.getStorageSync("mobile"); if(!number){ wx.redirectTo({url:"../index/index"}); } }, loginback:function(){ var number = wx.getStorageSync("mobile"); this.getPhone(number); }, logOut:function(){ wx.removeStorageSync("mobile"); wx.removeStorageSync("authorization"); this.openLog(); } },logs,share))