index.uvue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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:any) => {
  53. this.user = response.data as UTSJSONObject
  54. this.roleGroup = response.roleGroup as string
  55. this.postGroup = response.postGroup as string
  56. })
  57. }
  58. }
  59. }
  60. </script>
  61. <style lang="scss">
  62. .my-page {
  63. background-color: #ffffff;
  64. width: 100%;
  65. height: 100%;
  66. }
  67. .item {
  68. width: 100%;
  69. display: flex;
  70. align-items: center;
  71. padding: 12px 15px;
  72. border-top: 1rpx solid rgba(0, 0, 0, 0.1);
  73. .icon {
  74. color: #007AFF;
  75. font-size: 16px;
  76. margin-right: 5px;
  77. }
  78. .text-right {
  79. margin-left: auto;
  80. color: #999;
  81. }
  82. }
  83. .bottom-solid{
  84. border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);
  85. }
  86. </style>