CommunicationLogs.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <template>
  2. <view>
  3. <view class="total-num">
  4. 跟进记录<text>{{total}}</text>
  5. </view>
  6. <view class="com-ul">
  7. <view class="com-li" v-for="(item, index) in logs_list" :key="index">
  8. <view class="top clearfix">
  9. <view class="float_left staffName">{{ item.staffName }}</view>
  10. <view class="time float_right">{{ $u.timeFormat(item.time, 'yyyy-mm-dd hh:MM:ss') }}</view>
  11. </view>
  12. <view class="cont">{{ item.content }}</view>
  13. <view class="picture" v-if="item.picture">
  14. <image :src="item.picture" mode="aspectFill"></image>
  15. </view>
  16. <view class="address">{{ item.location }}</view>
  17. </view>
  18. </view>
  19. <u-loadmore :status="load_status" @loadmore="scrolltolower" :load-text="loadText" />
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. props: {
  25. customerId: {
  26. type: [Number, String],
  27. default: ''
  28. }
  29. },
  30. data() {
  31. return {
  32. loadText: {
  33. loadmore: '点击加载更多',
  34. loading: '努力加载中',
  35. nomore: '没有更多了'
  36. },
  37. load_status: 'nomore',
  38. logs_list: [],
  39. page: 1,
  40. pageSize: 10,
  41. total: 0
  42. };
  43. },
  44. created() {
  45. this.getAllCustomerCommunication();
  46. },
  47. methods: {
  48. scrolltolower() {
  49. if (this.total / this.pageSize > this.page) {
  50. this.page += 1;
  51. this.getAllCustomerCommunication();
  52. }
  53. },
  54. getAllCustomerCommunication() {
  55. this.load_status = 'loading';
  56. this.$u.api
  57. .getAllCustomerCommunication({
  58. page: this.page,
  59. pageSize: this.pageSize,
  60. customerId: this.customerId,
  61. staffId: '',
  62. star: '',
  63. end: ''
  64. })
  65. .then(res => {
  66. if (this.page === 1) {
  67. this.logs_list = res.data;
  68. } else {
  69. this.logs_list = this.logs_list.concat(res.data);
  70. }
  71. this.load_status = this.$utils.loadStatus(this.page, this.pageSize, res.pageTotal);
  72. this.total = res.pageTotal;
  73. });
  74. }
  75. }
  76. };
  77. </script>
  78. <style lang="scss" scoped>
  79. .log-scroll {
  80. height: 100vh;
  81. }
  82. .total-num{
  83. font-size: 24rpx;
  84. padding: 0 40rpx;
  85. line-height: 80rpx;
  86. text{
  87. color: #4076D6;
  88. margin-left: 8rpx;
  89. }
  90. }
  91. .com-ul {
  92. padding: 0 40rpx;
  93. .com-li {
  94. margin-bottom: 30rpx;
  95. padding-bottom: 30rpx;
  96. border-bottom: 1px dashed #B8C0C8;
  97. .top {
  98. .staffName{
  99. font-weight: 600;
  100. }
  101. .time{
  102. color: #CAD0D7;
  103. font-weight: 300;
  104. font-size: 24rpx;
  105. }
  106. }
  107. .cont {
  108. padding: 20rpx 0;
  109. line-height: 42rpx;
  110. }
  111. .picture{
  112. image{
  113. width: 300rpx;
  114. border-radius: 6rpx;
  115. height: 100rpx;
  116. display: block;
  117. }
  118. }
  119. .address{
  120. margin-top: 16rpx;
  121. color: #CAD0D7;
  122. font-weight: 400;
  123. font-size: 24rpx;
  124. }
  125. }
  126. }
  127. </style>