index.vue 3.1 KB

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