setting.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <page-layout class="user-setting">
  3. <nav-bar title="设置" @init="onInitNavbar"></nav-bar>
  4. <van-cell-group>
  5. <van-cell title="个人信息" is-link @click="navigateTo('/pages/user/info')">
  6. </van-cell>
  7. <van-cell class="user-logout" title="退出登录" is-link @click="onLogout">
  8. </van-cell>
  9. </van-cell-group>
  10. </page-layout>
  11. </template>
  12. <script>
  13. import NavBar from '@/components/layout/nav-bar'
  14. import UScrollView from '@/components/common/u-scroll-view'
  15. import VanCellGroup from '@/wxcomponents/vant/cell-group/index'
  16. import VanCell from '@/wxcomponents/vant/cell/index'
  17. import PageLayout from "@/components/layout/page-layout";
  18. export default {
  19. options: {
  20. styleIsolation: 'shared'
  21. },
  22. components: {
  23. PageLayout,
  24. NavBar,
  25. UScrollView,
  26. VanCellGroup,
  27. VanCell
  28. },
  29. computed: {
  30. },
  31. data() {
  32. return {}
  33. },
  34. created() {
  35. this.checkAuth('/pages/user/setting')
  36. },
  37. onShow() {},
  38. methods: {
  39. onLogout() {
  40. // this.$store.dispatch('logout').then(() => {
  41. // uni.navigateTo({
  42. // url: '/pages/user/login'
  43. // })
  44. // })
  45. this.$store.dispatch('logout').then(() => {
  46. this.redirectTo('/pages/user/login')
  47. })
  48. }
  49. }
  50. }
  51. </script>
  52. <style lang="scss">
  53. .user-setting{
  54. .user-logout{
  55. .van-cell__title{
  56. @include display-flex-center;
  57. }
  58. .van-icon{
  59. display: none;
  60. }
  61. }
  62. }
  63. </style>