task-item.vue 5.1 KB

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