index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <view class="container">
  3. <uni-list>
  4. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickname" />
  5. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.mobile" />
  6. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
  7. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="(user.posts || []).map(post => post.name).join(',')" />
  8. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="(user.roles || []).map(role => role.name).join(',')" />
  9. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="this.parseTime(user.createTime)" />
  10. </uni-list>
  11. </view>
  12. </template>
  13. <script>
  14. import { getUserProfile } from "@/api/system/user"
  15. import { parseTime } from "@/utils/ruoyi"
  16. export default {
  17. data() {
  18. return {
  19. user: {}
  20. }
  21. },
  22. onLoad() {
  23. this.getUser()
  24. },
  25. methods: {
  26. getUser() {
  27. getUserProfile().then(response => {
  28. this.user = response.data
  29. })
  30. },
  31. parseTime(time) {
  32. return parseTime(time)
  33. }
  34. }
  35. }
  36. </script>
  37. <style lang="scss">
  38. page {
  39. background-color: #ffffff;
  40. }
  41. </style>