task-item.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="p-t20">
  3. <view class="task-body m-lr20 animate__animated animate__fadeIn" v-if="taskList.length>0">
  4. <view class="row-c page-box-bg-fff m-b20 r-30 box-shadow-197" v-for="(item,index) in taskList" :key="index"
  5. @click="onTaskDetails(item)">
  6. <view class="main_string" :style="{background:lineColor[item.product_id%3]}"></view>
  7. <view class="row-c flex p-30">
  8. <image class="wh-80" :src="item.product_icon" mode=""></image>
  9. <view class="flex m-l20">
  10. <view class="row-justify-sb center flex">
  11. <text class="text-color-333 sys-weight-600">{{item.product_name}}</text>
  12. <view class="row-c line-40" @click.stop="makingCall(item.phone)">
  13. <text class="size-26 text-color-333">{{item.name}}</text>
  14. <image class="wh-30 m-l16"
  15. src="https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/task-phone.png"
  16. mode=""></image>
  17. </view>
  18. </view>
  19. <view
  20. class="p-tb14 p-lr30 m-tb20 r-100 row-justify-sb center size-24 text-color-12 sys-from-background-color"
  21. style="line-height: 40rpx;">
  22. <text class="size-28 text-color-E21 sys-weight-600">{{item.quota}}万</text>
  23. <text>{{item.stage_name}}</text>
  24. <text>{{item.use_date}}用款</text>
  25. </view>
  26. <view class="row-justify-sb center" style="line-height: 40rpx;">
  27. <text class="size-24 text-color-999 flex">{{item.created_date}}</text>
  28. <image class="animate__animated animate__jello" style="width: 65rpx;height: 32rpx;"
  29. :src="'/static/img/task/day-stast-'+item.status+'.png'" v-if="type === 5">
  30. </image>
  31. <image class="animate__animated animate__jello" style="width: 65rpx;height: 32rpx;"
  32. :src="'/static/img/task/task-status-'+item.status+'.png'" v-if="type === 1">
  33. </image>
  34. <button class="button-background en_button sys-weight-500 text-color-fff size-28 r-100"
  35. style="width: 200rpx;height: 70rpx;line-height: 70rpx;" type="default"
  36. hover-class="is-hover" v-else-if="type === 2"
  37. @click.stop="takeTask(index)">领取任务</button>
  38. <button class="button-background en_button sys-weight-500 text-color-fff size-28 r-100"
  39. style="width: 200rpx;height: 70rpx;line-height: 70rpx;" type="default"
  40. hover-class="is-hover" v-else-if="type === 4">去处理</button>
  41. <view class="row-c" v-else-if="type === 3">
  42. <button
  43. class="button-backgroun en_buttond left_button sys-weight-500 button_color-008FD6 size-26 r-100 m-r20"
  44. type="default" hover-class="is-hover">核算</button>
  45. <button
  46. class="button-background en_button left_button right_button sys-weight-500 button_color-008FD6 size-26 r-100"
  47. type="default" hover-class="is-hover">客户分类</button>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. <view class="placeholder sys-list-background-color" v-if="is_bottom && taskList.length"></view>
  54. </view>
  55. <en-blank v-else></en-blank>
  56. </view>
  57. </template>
  58. <script>
  59. import EnButton from "@/components/en-utils/en-button/en-button.vue";
  60. import {
  61. takeTask
  62. } from "@/api/task";
  63. import tools from "@/service/tools";
  64. import EnBlank from "@/components/en-utils/en-blank/en-blank.vue";
  65. export default {
  66. components: {
  67. EnBlank,
  68. EnButton
  69. },
  70. props: {
  71. type: {
  72. type: Number,
  73. default: 1
  74. },
  75. taskList: {
  76. type: Array,
  77. default: () => []
  78. },
  79. iconStatus: {
  80. type: Number,
  81. default: 1
  82. },
  83. leftImgStatus: {
  84. type: Number,
  85. default: 0
  86. },
  87. opacity: {
  88. type: Number,
  89. default: 0
  90. },
  91. back: {
  92. type: Boolean,
  93. default: false
  94. },
  95. is_bottom: {
  96. type: Boolean,
  97. default: false
  98. },
  99. },
  100. data() {
  101. return {
  102. leftImg: ['task-house', 'task-business', 'task-repayment'],
  103. iconList: ['task-audit', 'task-do', 'task-stay'],
  104. lineColor: ['#EF8F27', '#DE5847', '#0FB160'],
  105. isAjax: false
  106. }
  107. },
  108. methods: {
  109. makingCall(phone) {
  110. tools.makingCall(phone)
  111. },
  112. takeTask(index) {
  113. if (this.isAjax) {
  114. return;
  115. }
  116. this.isAjax = true;
  117. takeTask({
  118. 'id': this.taskList[index].id
  119. }).then((res) => {
  120. this.isAjax = false
  121. if (res.code === 1) {
  122. tools.success(res.msg)
  123. // this.taskList.splice(index, 1)
  124. this.$emit('takeTask', index)
  125. } else {
  126. tools.error(res.msg)
  127. }
  128. })
  129. },
  130. getIconStatus() {
  131. return `https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/${this.iconList[this.iconStatus]}.png`
  132. },
  133. getLeftImg() {
  134. return `https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/${this.leftImg[this.leftImgStatus]}.png`
  135. },
  136. onTaskDetails(item) {
  137. if (item.business_id) {
  138. uni.navigateTo({
  139. url: '/page_task/task_details/task_details?taskId=' + item.business_id
  140. })
  141. } else {
  142. uni.navigateTo({
  143. url: '/page_task/task_details/task_details?taskId=' + item.id
  144. })
  145. }
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang="scss" scoped>
  151. .en_button {
  152. border: none;
  153. }
  154. .task-body {
  155. height: 100%;
  156. }
  157. .left_button {
  158. width: 122rpx;
  159. height: 56rpx;
  160. color: #008FD6;
  161. line-height: 56rpx;
  162. background: #FFFFFF;
  163. border: 1rpx solid #008FD6;
  164. border-radius: 100rpx;
  165. }
  166. .right_button {
  167. width: 160rpx;
  168. }
  169. .placeholder {
  170. height: 40rpx;
  171. }
  172. .main_string {
  173. width: 6rpx;
  174. height: 60rpx;
  175. border-radius: 100rpx;
  176. background: red;
  177. }
  178. button::after {
  179. border: none;
  180. }
  181. </style>