spring
4 天以前 435881d494e2be4ba5ce8bfccb02d6ef49e07314
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<template>
  <view class="wrap">
    <js-lang title="user.title"></js-lang>
    <view class="header">
      <view class="userinfo">
        <view class="image" @click="navTo('info')"
        >
          <image :src="image"></image
          >
        </view>
        <view class="info">
          <view class="username">{{
              vuex_username || $t("login.noLogin")
            }}
          </view>
          <view class="usercode">{{
              vuex_client_id || $t("login.noLogin")
            }}
          </view>
        </view>
      </view>
      <view class="logout"
      >
        <u-button type="success" shape="circle" size="mini" @click="logout">{{
            $t("login.logoutButton")
          }}
        </u-button>
      </view
      >
    </view>
    <view class="u-p-t-10 u-p-b-20">
      <view class="u-m-t-20">
        <u-cell-group>
          <u-cell-item
              icon="account"
              :iconSize="iconSize"
              :iconStyle="{ color: '#266bff' }"
              title="个人信息"
              @click="navTo('info')"
          ></u-cell-item>
          <u-cell-item
              icon="lock"
              :iconSize="iconSize"
              :iconStyle="{ color: '#1bca6a' }"
              title="修改密码"
              @click="navTo('pwd')"
          ></u-cell-item>
          <u-cell-item
              icon="question-circle"
              :iconSize="iconSize"
              :iconStyle="{ color: '#d99e59' }"
              title="在线客服"
              @click="chat()"
          ></u-cell-item>
        </u-cell-group>
      </view>
    </view>
  </view>
</template>
<script>
import config from "../../../common/config";
 
export default {
  data() {
    return {
      iconSize: 38,
      image: undefined,
    };
  },
  onLoad() {
    this.image = config.baseUrl + this.vuex_user.avatar;
  },
  methods: {
    navTo(url) {
      uni.navigateTo({
        url: url,
      });
    },
    logout() {
      this.$u.api.logout().then((res) => {
        this.$u.toast(res.message);
 
        //清空存储信息
        this.$u.vuex("vuex_token", "");
        this.$u.vuex("vuex_refresh_token", "");
        this.$u.vuex("vuex_username", "");
        this.$u.vuex("vuex_userId", "");
        this.$u.vuex("vuex_client_id", "");
        this.$u.vuex("vuex_user", {});
 
        setTimeout(() => {
          uni.reLaunch({
            url: "/pages/sys/login/index",
          });
        }, 500);
      });
    },
    chat() {
      // #ifdef MP
      wx.openCustomerServiceChat({
        extInfo: {
          url: 'https://work.weixin.qq.com/kfid/kfc72b7650fd8e9f664'
        },
        corpId: 'wwdfd8cc3eb1127464',
        success(res) {
        },
        fail(res) {
          console.log(res)
        }
      })
      // #endif
    }
  },
};
</script>
<style lang="scss">
@import "index-old.scss";
 
page {
  background-color: #f8f8f8;
}
</style>