index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template>
  2. <view class="followRecord_wrap">
  3. <rxl-timeline class="followRecord_timeLine_wrap" v-if="!isEmpty(dataList)">
  4. <rxl-timeline-item :timestamp="key" :size="10" color="#108cff" v-for="(followList,key,index) in dataList"
  5. :key="key+index">
  6. <view slot="body">
  7. <view class="body_wrap" v-for="(item) in followList" :key="item.id">
  8. <view class="body_top">
  9. <view class="body_top_left">
  10. <image src="@/static/case/icon-avatar.png" mode=""></image>
  11. <text class="follow">{{item.createNickname}}</text>
  12. </view>
  13. <view class="body_top_right" @click="handleDelete(item)">
  14. 删除
  15. </view>
  16. </view>
  17. <view class="body_center">
  18. {{item.content}}
  19. </view>
  20. <view class="body_bottom">
  21. <u-icon name="clock" color="#C0C0C7"></u-icon>
  22. <text class="date">{{item.createTime}}</text>
  23. </view>
  24. </view>
  25. </view>
  26. </rxl-timeline-item>
  27. </rxl-timeline>
  28. <view v-else class="empty_wrap">
  29. 暂无跟进记录
  30. </view>
  31. <u-modal :show="showModal"
  32. @confirm="confirm"
  33. ref="uModal"
  34. :asyncClose="true"
  35. showCancelButton
  36. @cancel="showModal = false"
  37. cancelColor="#409eff"
  38. :confirmText="'删除'" confirmColor="#f8836c">
  39. <view class="modal_box">
  40. 确定要删除跟进记录
  41. </view>
  42. </u-modal>
  43. </view>
  44. </template>
  45. <script>
  46. import {
  47. groupBy,
  48. isEmpty
  49. } from "lodash";
  50. export default {
  51. props: {
  52. clueId: {
  53. required: true
  54. }
  55. },
  56. data() {
  57. return {
  58. list: [0, 1],
  59. dataList: {},
  60. showModal: false,
  61. currentDeleteFollowId : undefined
  62. }
  63. },
  64. methods: {
  65. handleDelete(item){
  66. const { id } = item;
  67. this.currentDeleteFollowId = id;
  68. this.showModal = true;
  69. },
  70. isEmpty,
  71. async getData() {
  72. const {
  73. data
  74. } = await uni.$u.api.getClueFollowList({
  75. clueId: this.clueId
  76. });
  77. this.dataList = data;
  78. },
  79. async confirm() {
  80. await uni.$u.api.deleteClueFollow([this.currentDeleteFollowId]);
  81. uni.$u.toast("删除成功");
  82. this.getData();
  83. this.showModal = false;
  84. },
  85. },
  86. mounted() {
  87. this.getData();
  88. },
  89. beforeDestroy(){
  90. uni.$off('addFollowSuccess');
  91. },
  92. created() {
  93. uni.$on('addFollowSuccess',()=>{
  94. this.getData();
  95. });
  96. }
  97. }
  98. </script>
  99. <style lang="scss" scoped>
  100. .followRecord_wrap {
  101. min-height: 400px;
  102. background: #f5f6f8;
  103. position: relative;
  104. .empty_wrap {
  105. text-align: center;
  106. color: #999999;
  107. position: absolute;
  108. left: 50%;
  109. top: 50%;
  110. transform: translate(-50%, -50%);
  111. }
  112. }
  113. .followRecord_timeLine_wrap {
  114. background: #ffffff;
  115. .timeline-item {
  116. &:last-child {
  117. ::v-deep .left-line .timeline-item-tail {
  118. display: none;
  119. }
  120. }
  121. }
  122. }
  123. .body_wrap {
  124. margin-bottom: 20rpx;
  125. background-color: #f6f7f8;
  126. padding: 20rpx;
  127. border-radius: 20rpx;
  128. &:last-child {
  129. margin-bottom: 0;
  130. }
  131. .body_top {
  132. display: flex;
  133. align-items: center;
  134. justify-content: space-between;
  135. .body_top_left {
  136. display: flex;
  137. align-items: center;
  138. image {
  139. width: 46rpx;
  140. height: 46rpx;
  141. margin-right: 12rpx;
  142. }
  143. .follow {
  144. color: #202020;
  145. font-size: 30rpx;
  146. margin-right: 12rpx;
  147. }
  148. .debt {
  149. color: #999999;
  150. font-size: 24rpx;
  151. }
  152. }
  153. .body_top_right {
  154. color: #108CFF;
  155. font-size: 24rpx;
  156. }
  157. }
  158. .body_center {
  159. margin: 30rpx 0;
  160. padding-left: 56rpx;
  161. overflow: hidden;
  162. }
  163. .body_bottom {
  164. display: flex;
  165. padding-left: 56rpx;
  166. ::v-deep .u-icon__icon {
  167. font-size: 24rpx !important;
  168. }
  169. .date {
  170. color: #c0c0c7;
  171. font-size: 22rpx;
  172. margin-left: 10rpx;
  173. }
  174. }
  175. }
  176. </style>