setting.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <view>
  3. <u-navbar :border-bottom="false" :is-back="true" title="设置">
  4. </u-navbar>
  5. <view>
  6. <u-cell-group>
  7. <u-cell-item title="个人信息" @click="profile"></u-cell-item>
  8. </u-cell-group>
  9. <u-cell-group class="u-m-t-20">
  10. <u-cell-item title="修改密码" @click="changePassword"></u-cell-item>
  11. </u-cell-group>
  12. </view>
  13. <view class="u-m-20">
  14. <u-button plain type="default" @click="logout">退出登录</u-button>
  15. </view>
  16. <view class="version">Version {{ vuex_version }}</view>
  17. </view>
  18. </template>
  19. <script>
  20. export default {
  21. data() {
  22. return {}
  23. },
  24. onLoad() {
  25. },
  26. methods: {
  27. profile() {
  28. this.$u.route('/pages/profile/profile')
  29. },
  30. logout() {
  31. // 登录成功修改token与用户信息
  32. this.$u.vuex('vuex_token', '');
  33. this.$u.vuex('vuex_user', {});
  34. return uni.reLaunch({
  35. url: '../index/index'
  36. })
  37. },
  38. changePassword() {
  39. this.$u.route('/pages/profile/password')
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss">
  45. .loginBtn {
  46. margin: 15 rpx;
  47. }
  48. .version {
  49. position: absolute;
  50. bottom: 15 rpx;
  51. width: 100%;
  52. text-align: center;
  53. }
  54. </style>