index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <div class="CustomerList">
  3. <div class="item acea-row row-between-wrapper" v-for="item in list" :key="item.id" @click="goPage(item)">
  4. <div class="pictrue"><img :src="item.avatar" /></div>
  5. <div class="text line1">{{ item.nickname }}</div>
  6. </div>
  7. </div>
  8. </template>
  9. <script>
  10. import { serviceList } from '@/api/user';
  11. export default {
  12. name: 'CustomerList',
  13. data() {
  14. return {
  15. list: [],
  16. productId: 0,
  17. orderId: ''
  18. };
  19. },
  20. methods: {
  21. getList() {
  22. serviceList().then(res => {
  23. this.list = res.data;
  24. });
  25. },
  26. goPage(item) {
  27. //console.log('11111')
  28. uni.navigateTo({
  29. url:'/pages/customer_list/chat?uid='+item.uid+'&productId='+ this.productId+'&orderId='+this.orderId
  30. });
  31. }
  32. },
  33. onLoad(option) {
  34. this.getList();
  35. if (option.productId) {
  36. this.productId = option.productId;
  37. }
  38. if (option.orderId) {
  39. this.orderId = option.orderId;
  40. }
  41. }
  42. };
  43. </script>
  44. <style scoped>
  45. .CustomerList {
  46. margin-top: 20rpx;
  47. }
  48. .CustomerList .item {
  49. height: 138rpx;
  50. border-bottom: 1px solid #eee;
  51. padding: 0 24rpx;
  52. background-color: #fff;
  53. display: flex;
  54. align-items: center;
  55. }
  56. .CustomerList .item .pictrue {
  57. width: 90rpx;
  58. height: 90rpx;
  59. border-radius: 50%;
  60. border: 3rpx solid #fff;
  61. box-shadow: 0 0 1rpx 5rpx #f3f3f3;
  62. }
  63. .CustomerList .item .pictrue img {
  64. width: 100%;
  65. height: 100%;
  66. border-radius: 50%;
  67. }
  68. .CustomerList .item .text {
  69. margin-left: 20rpx;
  70. width: 582rpx;
  71. font-size: 32rpx;
  72. color: #000;
  73. }
  74. </style>