personalCenter.js 3.8 KB
// pages/personalCenter/personalCenter.js
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tab_state: false,
    withdraw_state: false,
    currentTab: 0,
    user_type: 0
  },

  //点击切换
  tabCharge(e) {
    var that = this;
    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.target.dataset.current
      })
    }
  },

  //展开收起
  tabExpand() {
    this.setData({
      tab_state: !(this.data.tab_state)
    })
  },
  //我要提现
  withdraw() {
    this.setData({
      withdraw_state: true
    })
  },
  //确认提现
  confirmWithdrawal() {
    var that = this
    wx.showToast({
      title: '提交成功,请等待后台审核',
      success: function() {
        setTimeout(function() {
          that.setData({
            withdraw_state: false
          })
        }, 2000)
      }
    })
  },

  //修改个人资料
  editInfo() {
    wx.navigateTo({
      url: '../index/editProfile/editProfile',
    })
  },

  //T币交易记录
  TB() {
    wx.navigateTo({
      url: '../index/TB/TB',
    })
  },

  //会员充值
  vipCharge() {
    wx.navigateTo({
      url: '../index/VipRecharge/VipRecharge',
    })
  },

  //报告浏览记录
  reportList() {
    wx.navigateTo({
      url: '../index/browseRecord/browseRecord',
    })
  },

  //文章浏览记录
  articlList() {
    wx.navigateTo({
      url: '../index/articleBrowseRecord/articleBrowseRecord',
    })
  },

  //建议预设
  suggest() {
    wx.navigateTo({
      url: '../index/Suggest/Suggest',
    })
  },

  //方案预设
  project() {
    wx.navigateTo({
      url: '../index/Program/Program',
    })
  },

  //分享赚T币
  share() {
    wx.navigateTo({
      url: '../index/share/share',
    })
  },

  //下载专属二维码
  twoCode() {
    wx.navigateTo({
      url: '../index/twoCode/twoCode',
    })
  },

  //邀请名单
  inviteList() {
    wx.navigateTo({
      url: '../index/inviteList/inviteList',
    })
  },

  //7天到期提醒
  remind() {
    wx.navigateTo({
      url: '../index/smartRemind/smartRemind',
    })
  },
  //////////     客户个人中心   ////////////////

  //保单列表
  policyList() {
    wx.navigateTo({
      url: '../index/policyList/policyList',
    })
  },
  //体检报告
  medicalReport() {
    wx.navigateTo({
      url: '../index/reportList/reportList',
    })
  },
  //顾问认证
  register() {
    wx.navigateTo({
      url: '../index/register/register',
    })
  },
  //顾问信息
  consultantInfo() {
    wx.navigateTo({
      url: '../index/editProfile/editProfile',
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    this.setData({
      user_type: app.globalData.UserType
    })
    if (app.globalData.UserType == 2) { //用户类型(2为普通会员,3为顾问,4为推广)
      wx.setNavigationBarTitle({
        title: '客户个人中心'
      })
    } else if (app.globalData.UserType == 3) {
      wx.setNavigationBarTitle({
        title: '顾问个人中心'
      })
    } else if (app.globalData.UserType == 4) {
      wx.setNavigationBarTitle({
        title: '推广员个人中心'
      })
    } 
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})