index.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="container">
  3. <view class="lists mb12" @click.stop="handleToAvatar">
  4. <view class="tit">头像照片</view>
  5. <view class="txt"></view>
  6. <image v-if="avatar" :src="avatar" class="avaimg" mode="aspectFill"></image>
  7. <image v-else :src="avatarimg" class="avaimg" mode="aspectFill"></image>
  8. <image :src="rimg" class="rimg"></image>
  9. </view>
  10. <view class="lists">
  11. <view class="tit">用户名称</view>
  12. <view class="txt">{{user.nickName}}</view>
  13. <image :src="rimg" class="rimg"></image>
  14. </view>
  15. <view class="lists">
  16. <view class="tit">所属部门</view>
  17. <view class="txt">{{deptName}}
  18. <block v-if="postGroup">/{{postGroup}}</block>
  19. </view>
  20. <image :src="rimg" class="rimg"></image>
  21. </view>
  22. <view class="lists">
  23. <view class="tit">联系方式</view>
  24. <view class="txt">{{user.phonenumber}}</view>
  25. <image :src="rimg" class="rimg"></image>
  26. </view>
  27. <view class="lists">
  28. <view class="tit">角色</view>
  29. <view class="txt">{{roleGroup}}</view>
  30. <image :src="rimg" class="rimg"></image>
  31. </view>
  32. <!-- <uni-list>
  33. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickName" />
  34. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.phonenumber" />
  35. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
  36. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" />
  37. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" />
  38. <uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" />
  39. </uni-list> -->
  40. </view>
  41. </template>
  42. <script>
  43. import { getUserProfile } from "@/api/system/user"
  44. export default {
  45. data() {
  46. return {
  47. user: {},
  48. roleGroup: "",
  49. postGroup: "",
  50. deptName:'',
  51. avatarimg:require("@/static/images/mine/profile.png"),
  52. rimg:require("@/static/images/mine/rimg.png"),
  53. }
  54. },
  55. computed: {
  56. avatar() {
  57. return this.$store.state.user.avatar
  58. },
  59. },
  60. onLoad() {
  61. this.getUser()
  62. },
  63. methods: {
  64. getUser() {
  65. getUserProfile().then(response => {
  66. this.user = response.data
  67. this.roleGroup = response.roleGroup
  68. this.postGroup = response.postGroup
  69. var data=response.data;
  70. if(data.dept&&data.dept.deptName){
  71. this.deptName=data.dept.deptName
  72. }
  73. })
  74. },
  75. handleToAvatar() {
  76. this.$tab.navigateTo('/pages/mine/avatar/index')
  77. },
  78. }
  79. }
  80. </script>
  81. <style lang="scss">
  82. page {
  83. background-color: #E6E6E6;
  84. }
  85. .lists{background-color: #ffffff;min-height: 120rpx;box-sizing: border-box;
  86. display: flex;align-items: center;padding: 30rpx 36rpx 30rpx 34rpx;border-bottom: 2rpx solid #E6E6E6;
  87. .tit{font-weight: bold;font-size: 30rpx;color: #343434;flex: 0 0 auto;}
  88. .rimg{flex: 0 0 auto;width: 16rpx;height: 22rpx;margin-left: 28rpx;}
  89. .txt{flex: 1;text-align: right;margin-left: 28rpx;font-weight: 500;font-size: 30rpx;color: #343434;}
  90. .avaimg{width: 110rpx;height: 110rpx;border-radius:10rpx;flex: 0 0 auto;}
  91. }
  92. </style>