index.uvue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class=" container my-page">
  3. <list-view >
  4. <list-item class="uni-row item">
  5. <uni-icons class="icon" type="person-filled"></uni-icons>
  6. <text class="font-14">昵称</text>
  7. <text class="font-12 text-right">{{user.nickName}}</text>
  8. </list-item>
  9. <list-item class="uni-row item">
  10. <uni-icons class="icon" type="phone-filled"></uni-icons>
  11. <text class="font-14">手机号码</text>
  12. <text class="font-12 text-right">{{user.phonenumber}}</text>
  13. </list-item>
  14. <list-item class="uni-row item">
  15. <uni-icons class="icon" type="email-filled"></uni-icons>
  16. <text class="font-14">邮箱</text>
  17. <text class="font-12 text-right">{{user.email}}</text>
  18. </list-item>
  19. <list-item class="uni-row item">
  20. <uni-icons class="icon" type="auth-filled"></uni-icons>
  21. <text class="font-14">岗位</text>
  22. <text class="font-12 text-right">{{postGroup}}</text>
  23. </list-item>
  24. <list-item class="uni-row item">
  25. <uni-icons class="icon" type="staff-filled"></uni-icons>
  26. <text class="font-14">角色</text>
  27. <text class="font-12 text-right">{{roleGroup}}</text>
  28. </list-item>
  29. <list-item class="uni-row item bottom-solid">
  30. <uni-icons class="icon" type="calendar-filled"></uni-icons>
  31. <text class="font-14">创建日期</text>
  32. <text class="font-12 text-right">{{user.createTime}}</text>
  33. </list-item>
  34. </list-view>
  35. </view>
  36. </template>
  37. <script lang="uts">
  38. import { getUserProfile } from "@/api/system/user"
  39. export default {
  40. data() {
  41. return {
  42. user: {} as UTSJSONObject,
  43. roleGroup: "" as string,
  44. postGroup: "" as string
  45. }
  46. },
  47. onLoad() {
  48. this.getUser()
  49. },
  50. methods: {
  51. getUser() {
  52. getUserProfile().then((response:UTSJSONObject) => {
  53. if (response != null) {
  54. this.user = response.get('data') as UTSJSONObject
  55. this.roleGroup = response.get('roleGroup') as string
  56. this.postGroup = response.get('postGroup') as string
  57. }
  58. })
  59. }
  60. }
  61. }
  62. </script>
  63. <style lang="scss">
  64. .my-page {
  65. background-color: #ffffff;
  66. width: 100%;
  67. height: 100%;
  68. }
  69. .item {
  70. width: 100%;
  71. display: flex;
  72. align-items: center;
  73. padding: 12px 15px;
  74. border-top: 1rpx solid rgba(0, 0, 0, 0.1);
  75. .icon {
  76. color: #007AFF;
  77. font-size: 16px;
  78. margin-right: 5px;
  79. }
  80. .text-right {
  81. margin-left: auto;
  82. color: #999;
  83. }
  84. }
  85. .bottom-solid{
  86. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  87. }
  88. </style>