list.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <template>
  2. <view class="work-container">
  3. <view class="header">
  4. <u-search placeholder="请输入客户名称" :clearabled="true" @clear="searchDept" @custom="searchDept" v-model="search.userName" @search="searchDept"></u-search>
  5. </view>
  6. <view style="margin-top: 10px">
  7. <uni-list :border="true">
  8. <!-- 显示圆形头像 -->
  9. <view v-for="item in userList">
  10. <uni-list-chat v-if="item.avatar != ''" :avatar-circle="true" :title="item.nickName" :avatar="item.avatar" :note="item.phonenumber" :time="item.createTime" ></uni-list-chat>
  11. <uni-list-chat v-else :avatar-circle="true" :title="item.nickName" avatar="/static/images/device/user.png" :note="item.phonenumber" :time="item.createTime" ></uni-list-chat>
  12. </view>
  13. </uni-list>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import authObj from '@/plugins/auth.js';
  19. import {getDeptList,getUserListByDept} from '@/api/user/user';
  20. import UText from "../../uni_modules/uview-ui/components/u-text/u-text";
  21. export default {
  22. components: {UText},
  23. data() {
  24. return {
  25. userList:[],
  26. search:{
  27. userName:""
  28. },
  29. deptId:0,
  30. }
  31. },
  32. onLoad(opt){
  33. this.deptId = opt.deptId;
  34. this.getUser();
  35. },
  36. methods: {
  37. searchDept(){
  38. this.getUser();
  39. },
  40. change(item){
  41. console.log(item)
  42. },
  43. getUser(){
  44. let id = this.deptId;
  45. getUserListByDept(id,this.search.userName).then(res=>{
  46. this.userList = res.rows;
  47. for(const user of this.userList){
  48. }
  49. });
  50. },
  51. }
  52. }
  53. </script>
  54. <style lang="scss">
  55. /* #ifndef APP-NVUE */
  56. .u-collapse-content{
  57. display: flex;
  58. flex-direction: column;
  59. }
  60. page {
  61. display: flex;
  62. flex-direction: column;
  63. box-sizing: border-box;
  64. background-color: #fff;
  65. min-height: 100%;
  66. height: auto;
  67. }
  68. view {
  69. font-size: 14px;
  70. line-height: inherit;
  71. }
  72. /* #endif */
  73. .text {
  74. text-align: center;
  75. font-size: 26rpx;
  76. margin-top: 10rpx;
  77. }
  78. .grid-item-box {
  79. flex: 1;
  80. /* #ifndef APP-NVUE */
  81. display: flex;
  82. /* #endif */
  83. flex-direction: column;
  84. align-items: center;
  85. justify-content: center;
  86. padding: 15px 0;
  87. }
  88. .uni-margin-wrap {
  89. width: 690rpx;
  90. width: 100%;
  91. ;
  92. }
  93. .swiper {
  94. height: 300rpx;
  95. }
  96. .swiper-box {
  97. height: 150px;
  98. }
  99. .swiper-item {
  100. /* #ifndef APP-NVUE */
  101. display: flex;
  102. /* #endif */
  103. flex-direction: column;
  104. justify-content: center;
  105. align-items: center;
  106. color: #fff;
  107. height: 300rpx;
  108. line-height: 300rpx;
  109. }
  110. @media screen and (min-width: 500px) {
  111. .uni-swiper-dot-box {
  112. width: 400px;
  113. /* #ifndef APP-NVUE */
  114. margin: 0 auto;
  115. /* #endif */
  116. margin-top: 8px;
  117. }
  118. .image {
  119. width: 100%;
  120. }
  121. }
  122. </style>