task-item.vue 5.4 KB

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