Blame view

pages/setting/setting.vue 2.15 KB
28010de0   chenbiao   add 发票申领 发票填充
1
  <template>
e1beceff   刘淇   二维码保存图片
2
3
4
5
6
7
8
      <view>
          <view class="setting-content">
              <uni-list>
                  <uni-list-item title="关于我们" clickable @click="toAboutOur" showArrow></uni-list-item>
                  <uni-list-item title="修改登录密码" clickable @click="toRevisePwd" showArrow></uni-list-item>
                  <uni-list-item title="清除缓存" clickable @click="cleanStorage"></uni-list-item>
              </uni-list>
93c5ecb3   chenbiao   add 添加filter.js 设...
9
  
e1beceff   刘淇   二维码保存图片
10
11
12
              <view class="uni-padding-wrap uni-common-mt">
                  <button type="warn" @click="loginOutAlert">退出登录</button>
              </view>
28010de0   chenbiao   add 发票申领 发票填充
13
  
e1beceff   刘淇   二维码保存图片
14
          </view>
93c5ecb3   chenbiao   add 添加filter.js 设...
15
  
e1beceff   刘淇   二维码保存图片
16
      </view>
28010de0   chenbiao   add 发票申领 发票填充
17
18
19
  </template>
  
  <script>
e1beceff   刘淇   二维码保存图片
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
  
  export default {
    data() {
      return {}
    },
    methods: {
      toRevisePwd() {
        uni.navigateTo({
          url: '../revisePwd/revisePwd'
        });
      },
      toAboutOur() {
        uni.navigateTo({
          url: '../aboutOur/aboutOur'
        });
      },
      cleanStorage() {
        uni.clearStorageSync();
        uni.showToast({
          title: "清理缓存成功",
          mask: false,
          duration: 2000
        })
      },
      loginOutAlert() {
        let that = this;
        uni.showModal({
          title: '提示',
          content: '是否确定退出登录?',
          success: (res) => {
            if (res.confirm) {
              that.loginOut();
            } else if (res.cancel) {
              console.log('用户点击取消')
            }
          }
        })
      },
      loginOut() {
        let that = this;
        that.$myRequest({
          url: that.$common.userLoginout,
          method: 'POST',
          data: that.$common.requestSign()
        }).then(res => {
          // 获取真实数据之前,务必判断状态是否为200
          console.log('退出:' + JSON.stringify(res));
          if (res.code == 0) {
            uni.clearStorageSync();
            uni.reLaunch({
              url: "../index/index"
            })
            uni.hideLoading();
          } else {
            uni.clearStorageSync();
            uni.reLaunch({
              url: "../index/index"
            })
            uni.hideLoading();
          }
        })
      }
    }
  }
28010de0   chenbiao   add 发票申领 发票填充
84
85
86
  </script>
  
  <style lang="scss">
e1beceff   刘淇   二维码保存图片
87
88
89
90
      .setting-content {
          background-color: #f6f6f6;
          height: 100vh;
      }
28010de0   chenbiao   add 发票申领 发票填充
91
  </style>