info.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="page-wrap">
  3. <view class="row">
  4. <view class="label">头像</view>
  5. <image class="avatar" src="../../static/auth-icon.png" mode="aspectFill"></image>
  6. </view>
  7. <view class="row">
  8. <view class="label">姓名</view>
  9. <view class="text">--</view>
  10. </view>
  11. <view class="row">
  12. <view class="label">绑定手机</view>
  13. <view class="text">{{ userInfo.phone }}</view>
  14. </view>
  15. <view class="space"></view>
  16. <view class="row">
  17. <view class="label">所属单位</view>
  18. <view class="text">--</view>
  19. </view>
  20. <view class="row">
  21. <view class="label">所属部门</view>
  22. <view class="text">--</view>
  23. </view>
  24. <view class="row">
  25. <view class="label">职务</view>
  26. <view class="text">--</view>
  27. </view>
  28. <view class="space" style="height: 27.47rpx"></view>
  29. <view class="row" @click="handleLogout">
  30. <view class="label">退出登录</view>
  31. </view>
  32. <uni-popup ref="alertDialog" type="dialog">
  33. <uni-popup-dialog
  34. type="info"
  35. cancelText="取消"
  36. confirmText="确认"
  37. title="系统提示"
  38. content="确认退出当前登录账号?"
  39. @confirm="dialogConfirm"
  40. @close="dialogClose"
  41. ></uni-popup-dialog>
  42. </uni-popup>
  43. </view>
  44. </template>
  45. <script>
  46. import userService from '@/api/user.js';
  47. export default {
  48. components: {},
  49. data() {
  50. return {
  51. userInfo: ''
  52. };
  53. },
  54. onLoad() {
  55. this.getUserInfo();
  56. },
  57. methods: {
  58. handleLogout() {
  59. this.$refs.alertDialog.open();
  60. },
  61. async getUserInfo() {
  62. const { data } = await userService.getUserInfo();
  63. this.userInfo = data;
  64. },
  65. async dialogConfirm() {
  66. await userService.logout();
  67. uni.navigateBack();
  68. }
  69. }
  70. };
  71. </script>
  72. <style lang="scss" scoped>
  73. .page-wrap {
  74. .row {
  75. min-height: 96.15rpx;
  76. font-size: 27.47rpx;
  77. display: flex;
  78. align-items: center;
  79. justify-content: space-between;
  80. padding: 20.6rpx 41.21rpx;
  81. box-sizing: border-box;
  82. background: #fff;
  83. position: relative;
  84. &:first-child::before,
  85. & + .row::before {
  86. content: '';
  87. position: absolute;
  88. left: 0;
  89. right: 0;
  90. top: 0;
  91. height: 1px;
  92. background: #e0e0e0;
  93. transform: scaleY(0.5);
  94. }
  95. .avatar {
  96. width: 82.42rpx;
  97. height: 82.42rpx;
  98. border-radius: 50%;
  99. }
  100. }
  101. .space {
  102. background: #f3f3f3;
  103. height: 13.74rpx;
  104. }
  105. }
  106. </style>