setting.js 1.82 KB
// packageMine/pages/setting/setting.js
import USERAPI from '~/api/usersApi/index'
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },
  jump(e) {
    console.log(e)
    let { url } = e.currentTarget.dataset
    const baseUrl = 'https://img01.glsx.com.cn/weapp/resource/saas/scrm/html/'
    const path = `${baseUrl}${url}.html`
    //   private user
    wx.navigateTo({
      url: `/pages/webView/webView?url=${encodeURIComponent(path)}`
    })
  },
  logout() {
    let _this = this
    wx.showModal({
      title: '退出登录确认',
      content: '您确定要退出销售助手小程序?',
      confirmColor: '#3582EE',
      success(res) {
        if (res.confirm) {
          // _this.showLoading()
          wx.$api.showLoading()
          USERAPI.logout().then(_res_ => {
            // wx.$storage.rm('fileList')
            wx.$storage.rm('sessionId')
            wx.$storage.rm('userInfo')
            wx.$storage.rm('auto_login_object')
            wx.$storage.rm('car_brand_list')
            wx.$router.reLaunch('login.index')
          })
        }
      }
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },

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

  },

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

  },

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

  },

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

  },

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

  },

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

  },

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

  }
})