index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="container">
  3. <view class="user">
  4. <u-icon name="../../static/image/icon-demo-1126.png" size="100rpx" style="margin-right:20rpx" />
  5. <view class="user-name">
  6. <view class="userName">
  7. {{userName}}
  8. </view>
  9. <view class="">
  10. 登录时间:{{lastLoginTime}}
  11. </view>
  12. </view>
  13. </view>
  14. <view class="list">
  15. <!-- <uni-list>
  16. <uni-list-item title="角色信息" thumb="../../static/image/qxgl.png" thumb-size="medium" link
  17. to="/pages/user/auth-level/index">
  18. </uni-list-item>
  19. <uni-list-item title="修改密码" thumb="../../static/image/klsz.png" thumb-size="medium" link
  20. to="/pages/user/edit-password/index">
  21. </uni-list-item>
  22. <uni-list-item title="系统信息" to="/pages/user/system-info/index" thumb="../../static/image/xtgl.png"
  23. thumb-size="medium" link>
  24. </uni-list-item>
  25. </uni-list> -->
  26. <u-cell-group>
  27. <u-cell size="large" title="角色信息" :isLink="true" icon="../../static/image/qxgl.png"
  28. url="/pages/user/auth-level/index"></u-cell>
  29. <u-cell size="large" title="修改密码" :isLink="true" icon="../../static/image/klsz.png"
  30. url="/pages/user/edit-password/index"></u-cell>
  31. <u-cell size="large" title="系统信息" :isLink="true" icon="../../static/image/xtgl.png"
  32. url="/pages/user/system-info/index"></u-cell>
  33. </u-cell-group>
  34. </view>
  35. <view class="btn">
  36. <u-button type="primary" text="退出登录" @click="show=true" size="large"></u-button>
  37. </view>
  38. <view>
  39. <u-modal :show="show" content='确定退出登录吗?' showCancelButton @confirm="loginOut" @cancel="show=false"
  40. width="270">
  41. </u-modal>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. //模态框
  50. show: false,
  51. };
  52. },
  53. computed: {
  54. userName() {
  55. return this.$store.getters.userName
  56. },
  57. lastLoginTime() {
  58. return this.$store.getters.lastLoginTime
  59. }
  60. },
  61. methods: {
  62. //退出登录
  63. loginOut() {
  64. this.$store.dispatch('user/logout').then(res => {
  65. if (res.data.code === 200) {
  66. uni.redirectTo({
  67. url: "/pages/login/index"
  68. })
  69. }
  70. })
  71. },
  72. }
  73. }
  74. </script>
  75. <style lang="scss" scoped>
  76. .container {
  77. background: #EEEDF2;
  78. }
  79. .user {
  80. display: flex;
  81. align-items: center;
  82. padding: 60rpx 40rpx;
  83. margin-bottom: 20rpx;
  84. background: #ffffff;
  85. }
  86. .user-name {
  87. font-weight: bold;
  88. .userName {
  89. font-size: 28rpx
  90. }
  91. }
  92. .list {}
  93. .btn {
  94. position: absolute;
  95. bottom: 100rpx;
  96. left: 0;
  97. right: 0;
  98. padding: 0 80rpx;
  99. }
  100. ::v-deep .uni-list-item__container {
  101. padding: 40rpx 60rpx;
  102. }
  103. ::v-deep .uni-list-item__content-title {
  104. font-size: 28rpx;
  105. }
  106. ::v-deep .uniui-arrowright {
  107. color: #000000 !important;
  108. font-size: 28rpx !important;
  109. }
  110. ::v-deep .u-modal__content__text {
  111. text-align: center;
  112. }
  113. </style>