legworkItem.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <view class="legwork-item">
  3. <view class="top">
  4. <wk-avatar
  5. :name="itemData.realname"
  6. :avatar="itemData.userImg"
  7. class="avatar" />
  8. <view class="info">
  9. <view class="user">
  10. <view class="text">
  11. {{ itemData.realname }}
  12. </view>
  13. <text class="time">
  14. {{ formatTime(itemData.createTime) }}
  15. </text>
  16. </view>
  17. <view class="address">
  18. {{ itemData.content.address }}
  19. </view>
  20. </view>
  21. </view>
  22. <view class="content">
  23. <view>{{ itemData.content.content }}</view>
  24. <wk-image-content
  25. v-if="itemData.img && itemData.img.length > 0"
  26. :list="itemData.img" />
  27. </view>
  28. <view class="customer">
  29. <view class="box" @click="handleToCustomer">
  30. <view>拜访客户:</view>
  31. <text class="text">
  32. {{ itemData.activityTypeName }}
  33. </text>
  34. </view>
  35. </view>
  36. <view
  37. v-if="deleteBtnAuth"
  38. class="more"
  39. @click.stop="handleDeleteAction">
  40. <image :src="$static('images/icon/dot.png')" alt="" class="dot" />
  41. <view
  42. v-if="showDeleteBtn"
  43. class="delete-box"
  44. @click.stop="handleDelete">
  45. <text class="wk wk-delete" />
  46. <text>删除</text>
  47. </view>
  48. </view>
  49. <view
  50. v-if="showDeleteBtn"
  51. class="mask"
  52. @click.stop="handleDeleteAction" />
  53. </view>
  54. </template>
  55. <script>
  56. import moment from 'moment'
  57. export default {
  58. name: 'LegworkItem',
  59. props: {
  60. itemData: {
  61. type: Object,
  62. required: true
  63. }
  64. },
  65. data() {
  66. return {
  67. showDeleteBtn: false
  68. }
  69. },
  70. computed: {
  71. deleteBtnAuth() {
  72. return this.$auth('crm.outwork.delete')
  73. }
  74. },
  75. methods: {
  76. formatTime(time) {
  77. return moment(time).format('MM-DD HH:mm')
  78. },
  79. handleDeleteAction() {
  80. this.showDeleteBtn = !this.showDeleteBtn
  81. },
  82. handleDelete() {
  83. this.showDeleteBtn = false
  84. this.$emit('delete', this.itemData.activityId)
  85. },
  86. handleToCustomer() {
  87. this.$Router.navigateTo({
  88. url: '/pages_crm/customer/detail',
  89. query: {
  90. id: this.itemData.activityId
  91. }
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .legwork-item {
  99. position: relative;
  100. background-color: white;
  101. border-bottom: 1rpx solid $border-color;
  102. padding: 26rpx 32rpx 32rpx;
  103. .top {
  104. width: 100%;
  105. @include left;
  106. .avatar {
  107. width: 80rpx;
  108. height: 80rpx;
  109. margin-right: 15rpx;
  110. }
  111. .info {
  112. flex: 1;
  113. overflow-x: hidden;
  114. overflow-y: auto;
  115. .user {
  116. font-size: 30rpx;
  117. @include left;
  118. .time {
  119. font-size: 24rpx;
  120. color: $light;
  121. margin-left: 15rpx;
  122. }
  123. }
  124. .address {
  125. flex: 1;
  126. font-size: 24rpx;
  127. color: $theme-color;
  128. margin-top: 5rpx;
  129. @include ellipsis;
  130. }
  131. }
  132. }
  133. .content {
  134. font-size: 28rpx;
  135. white-space: pre-wrap;
  136. word-wrap: break-word;
  137. padding: 26rpx 0;
  138. }
  139. .customer {
  140. width: 100%;
  141. overflow: hidden;
  142. display: flex;
  143. .box {
  144. font-size: $wk-font-mini;
  145. overflow: hidden;
  146. @include left;
  147. .icon {
  148. width: 28rpx;
  149. height: 28rpx;
  150. margin-right: 10rpx;
  151. }
  152. .text {
  153. flex: 1;
  154. color: $theme-color;
  155. @include ellipsis;
  156. }
  157. }
  158. }
  159. .more {
  160. position: absolute;
  161. top: 32rpx;
  162. right: 32rpx;
  163. width: 36rpx;
  164. overflow: unset;
  165. .dot {
  166. width: 36rpx;
  167. height: 36rpx;
  168. display: block;
  169. }
  170. .delete-box {
  171. position: absolute;
  172. top: 46rpx;
  173. left: -150rpx;
  174. z-index: 1000;
  175. width: 188rpx;
  176. font-size: 26rpx;
  177. color: #F95A5A;
  178. background-color: white;
  179. box-shadow: 0 0 16rpx 0 rgba(102,102,102,0.2);
  180. border-radius: 6rpx;
  181. padding: 10rpx 0;
  182. @include center;
  183. .wk {
  184. margin-right: 30rpx;
  185. font-size: 30rpx;
  186. }
  187. }
  188. }
  189. .mask {
  190. position: fixed;
  191. top: 0;
  192. left: 0;
  193. z-index: 500;
  194. width: 100%;
  195. height: 100%;
  196. background-color: rgba(0,0,0,0);
  197. }
  198. }
  199. </style>