index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view>
  3. <Navbar :hideBtn="true" bgColor="#f3f4f6"></Navbar>
  4. <view class="profile-top">
  5. <view class="user-info">
  6. <view>
  7. <view class="user-info--name">{{ user.nickName }}</view>
  8. <text class="user-info--account">{{ user.email || user.phonenumber || user.userName }}</text>
  9. </view>
  10. <view>
  11. <!-- <u-avatar src="/static/img/avatar.png" size="120rpx"></u-avatar> -->
  12. </view>
  13. </view>
  14. <view style="padding: 40rpx 40rpx 0 40rpx;">
  15. <view class="profile-rule">
  16. <u-row>
  17. <u-col span="8">
  18. <view style="color: white; font-size: 20px;">{{ user.dept ? user.dept.deptName : '未知部门' }}</view>
  19. </u-col>
  20. <!-- <u-col span="4">
  21. <u-button icon="question-circle" text="问题反馈" style="height: 36px;"></u-button>
  22. </u-col> -->
  23. </u-row>
  24. </view>
  25. </view>
  26. </view>
  27. <view style="padding: 40rpx; background-color: #fff;">
  28. <u-grid>
  29. <!-- <u-grid-item @click="navigateTo('/pages/center/profile')">
  30. <u-icon name="account-fill" color="#2979ff" size="60rpx"></u-icon>
  31. <text class="btn-text">个人资料</text>
  32. </u-grid-item>
  33. <u-grid-item @click="resetPassword = true">
  34. <u-icon name="lock-fill" color="#2979ff" size="60rpx"></u-icon>
  35. <text class="btn-text">修改密码</text>
  36. </u-grid-item>
  37. <u-grid-item @click="navigateTo('/pages/center/log')">
  38. <u-icon name="coupon-fill" color="#2979ff" size="60rpx"></u-icon>
  39. <text class="btn-text">操作日志</text>
  40. </u-grid-item> -->
  41. </u-grid>
  42. </view>
  43. <view style="padding: 40rpx; margin-top: 300rpx;">
  44. <u-row gutter="32">
  45. <u-col span="3">
  46. <!-- <u-button icon="phone" text="联系我们" plain></u-button> -->
  47. </u-col>
  48. <u-col span="6">
  49. <u-button icon="reload" text="退出" type="error" @click="logout"></u-button>
  50. </u-col>
  51. </u-row>
  52. </view>
  53. <Password :show="resetPassword" @close="resetPassword = false"></Password>
  54. </view>
  55. </template>
  56. <script>
  57. import Navbar from '@/components/navbar/Navbar'
  58. import Password from './password.vue'
  59. export default {
  60. components: {
  61. Navbar,
  62. Password,
  63. },
  64. data () {
  65. return {
  66. user: {},
  67. resetPassword: false
  68. }
  69. },
  70. created () {
  71. this.getInfo()
  72. },
  73. methods: {
  74. getInfo () {
  75. const app = this
  76. app.$store.dispatch('Info').then(res => {
  77. app.user = res.user
  78. })
  79. },
  80. navigateTo (url) {
  81. uni.navigateTo({ url: url })
  82. },
  83. logout () {
  84. const app = this
  85. app.$store.dispatch('Logout').then(res => {
  86. uni.reLaunch({
  87. url: '/pages/login/index'
  88. })
  89. })
  90. }
  91. }
  92. }
  93. </script>
  94. <style lang="scss">
  95. .profile-top {
  96. background-color: #f3f4f6;
  97. padding-top: 50rpx;
  98. }
  99. .profile-rule {
  100. height: 140rpx;
  101. line-height: 140rpx;
  102. padding: 0px 40rpx;
  103. background-color: #E60012;
  104. border-radius: 16px 16px 0 0;
  105. box-shadow: 0px 16px 26px rgba(0, 0, 0, .8);
  106. }
  107. .btn-text {
  108. font-size: 28rpx;
  109. color: #606266;
  110. }
  111. .user-info {
  112. display: flex;
  113. justify-content: space-between;
  114. padding: 40rpx;
  115. max-width: 100%;
  116. color: #303133;
  117. &--name {
  118. font-size: 56rpx;
  119. font-weight: bold;
  120. width: 100%
  121. }
  122. &--account {
  123. font-size: 26rpx;
  124. color: #909399;
  125. }
  126. }
  127. </style>