userList.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view>
  3. <view class="item" v-for="item in list" :key="item.sys_enterprise_hrid" hover-class="navigator-hover"
  4. @click="itemClick(item)">
  5. <u--image
  6. :src="item.headpic || 'https://yossys06593.obs.cn-east-3.myhuaweicloud.com:443/202406011717209838416B6150695f.webp'"
  7. :width="tovw(44)" :height="tovw(44)" shape="circle">
  8. <template v-slot:loading>
  9. <u-loading-icon color="red"></u-loading-icon>
  10. </template>
  11. </u--image>
  12. <view class="content">
  13. <view class="title u-line-1">
  14. {{ item.name }}
  15. </view>
  16. <view v-if="item.rolenames" class="row u-line-1">
  17. {{ item.rolenames }}
  18. </view>
  19. <view class="row">
  20. <text class="iconfont icon-dianhua-hui" />
  21. {{ item.phonenumber }}
  22. </view>
  23. <view class="row u-line-1">
  24. <text class="iconfont icon-morenmendian" />
  25. {{ item.storenames || '--' }}
  26. </view>
  27. <view class="row">
  28. 状态:
  29. <text :style="{ color: item.status == '启用' ? '#009270' : '#E3041F' }">
  30. {{ item.status }}
  31. </text>
  32. </view>
  33. </view>
  34. <view v-if="isDelete" class="iconfont icon-shanchu detele" @click.stop="deleteItem(item)" />
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. props: {
  41. list: {
  42. type: Array,
  43. default: []
  44. },
  45. onClick: {
  46. type: Function
  47. },
  48. isDelete: {
  49. type: Boolean,
  50. default: false
  51. },
  52. onDelete: {
  53. type: Function
  54. },
  55. },
  56. methods: {
  57. itemClick(item) {
  58. this.$emit("onClick", item)
  59. },
  60. deleteItem(item) {
  61. this.$emit("onDelete", item)
  62. }
  63. },
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. .item {
  68. position: relative;
  69. width: 355px;
  70. background: #FFFFFF;
  71. border-radius: 8px;
  72. padding: 10px;
  73. box-sizing: border-box;
  74. background: #fff;
  75. margin: 0 auto 10px;
  76. display: flex;
  77. .content {
  78. margin-left: 10px;
  79. .title {
  80. line-height: 24px;
  81. font-family: Source Han Sans SC, Source Han Sans SC;
  82. font-weight: bold;
  83. font-size: 16px;
  84. color: #333333;
  85. }
  86. .row {
  87. margin-top: 5px;
  88. font-family: Source Han Sans SC, Source Han Sans SC;
  89. font-size: 12px;
  90. color: #888888;
  91. .iconfont {
  92. margin-right: 5px;
  93. }
  94. }
  95. }
  96. .detele {
  97. position: absolute;
  98. right: 0;
  99. bottom: 0;
  100. padding: 10px;
  101. color: #999999;
  102. font-size: 14px;
  103. }
  104. }
  105. .item:last-child {
  106. margin-bottom: 0;
  107. }
  108. </style>