setting.vue 1.1 KB

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