index.vue 1.5 KB

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