task-item.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. <template>
  2. <view class="p-t20">
  3. <view class="task-body m-lr20 animate__animated animate__slideInLeft" v-if="taskList.length>0">
  4. <view class="item-box align-items-flex-start page-box-bg-fff m-b20 r-30 box-shadow-197 p-20 box-border-box"
  5. v-for="(item,index) in taskList" :key="index" @click="onTaskDetails(item)">
  6. <view class="main_string" :style="{background:lineColor[item.id%3]}"></view>
  7. <view class="m-r20 item-img-box flex-shrink0">
  8. <image :src="item.img" class="item-img r-40" mode="aspectFill"></image>
  9. <view class="proportion-box box-border-box" :style="{background:lineColor[item.id%3]}">
  10. {{item.proportion}}%
  11. </view>
  12. </view>
  13. <view class="flex-1 flex-direction">
  14. <view class="center row-justify-sb flex-1 mb-16">
  15. <view class="text-overflow-ellipsis-one size-30 max-w-80">
  16. {{item.name}}
  17. </view>
  18. <view class="" @click.stop="heartBut(item,true)" v-if="!item.live">
  19. <uni-icons type="heart" size="16" color="#99A1AF"></uni-icons>
  20. </view>
  21. <view class="animate__animated animate__zoomIn" @click.stop="heartBut(item,false)" v-else>
  22. <uni-icons type="heart-filled" size="16" color="#FB2C36"></uni-icons>
  23. </view>
  24. </view>
  25. <view class="center flex-1 mb-18">
  26. <uni-icons type="star-filled" size="16" color="#ff6b35"></uni-icons>
  27. <view class="size-28 mr-8">
  28. {{item.percentage}}
  29. </view>
  30. <view class="mr-8 fc-6A7383 sys-size-24 point">•</view>
  31. <view class="fc-6A7383 flex-1 sys-size-24 text-overflow-ellipsis-one max-w-60">
  32. {{item.description}}
  33. </view>
  34. </view>
  35. <view class="center mb-18">
  36. <view class="sys-size-24 mr-8 sys-weight-600 fc-00A63D">
  37. ${{item.amount}}M
  38. </view>
  39. <view class="mr-8 fc-6A7383 sys-size-24 point">•</view>
  40. <view class="mr-8 sys-size-24 fc-155DFB">
  41. {{item.trend}}
  42. </view>
  43. <view class="mr-8 fc-6A7383 sys-size-24 point">•</view>
  44. <view class="sys-size-24 fc-6A7383">
  45. {{item.risk}}
  46. </view>
  47. </view>
  48. <view class="center row-justify-sb">
  49. <view class="size-22 fc-99A1AF">
  50. #{{item.time}}
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. <view class="placeholder sys-list-background-color" v-if="is_bottom && taskList.length"></view>
  56. </view>
  57. <en-blank v-else></en-blank>
  58. </view>
  59. </template>
  60. <script>
  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. },
  67. props: {
  68. type: {
  69. type: Number,
  70. default: 1
  71. },
  72. taskList: {
  73. type: Array,
  74. default: () => []
  75. },
  76. iconStatus: {
  77. type: Number,
  78. default: 1
  79. },
  80. leftImgStatus: {
  81. type: Number,
  82. default: 0
  83. },
  84. opacity: {
  85. type: Number,
  86. default: 0
  87. },
  88. back: {
  89. type: Boolean,
  90. default: false
  91. },
  92. is_bottom: {
  93. type: Boolean,
  94. default: false
  95. },
  96. },
  97. data() {
  98. return {
  99. leftImg: ['task-house', 'task-business', 'task-repayment'],
  100. iconList: ['task-audit', 'task-do', 'task-stay'],
  101. lineColor: ['#EF8F27', '#DE5847', '#0FB160'],
  102. isAjax: false
  103. }
  104. },
  105. methods: {
  106. heartBut(item, type) {
  107. this.$emit('heartBut', {
  108. id: item.id,
  109. type: type
  110. })
  111. },
  112. goLoan(id) {
  113. uni.navigateTo({
  114. url: '/pages/loan/module/perfect_rate?id=' + id
  115. });
  116. },
  117. makingCall(phone) {
  118. tools.makingCall(phone)
  119. },
  120. getIconStatus() {
  121. return `https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/${this.iconList[this.iconStatus]}.png`
  122. },
  123. getLeftImg() {
  124. return `https://wealfavor-1257406827.cos.ap-beijing.myqcloud.com/new-xcx/task/${this.leftImg[this.leftImgStatus]}.png`
  125. },
  126. onTaskDetails(item) {
  127. if (item.business_id) {
  128. uni.navigateTo({
  129. url: '/page_task/task_details/task_details?taskId=' + item.business_id
  130. })
  131. } else {
  132. uni.navigateTo({
  133. url: '/page_task/task_details/task_details?taskId=' + item.id
  134. })
  135. }
  136. }
  137. }
  138. }
  139. </script>
  140. <style lang="scss" scoped>
  141. .en_button {
  142. border: none;
  143. }
  144. .task-body {
  145. height: 100%;
  146. }
  147. .left_button {
  148. width: 122rpx;
  149. height: 56rpx;
  150. color: #008FD6;
  151. line-height: 56rpx;
  152. background: #FFFFFF;
  153. border: 1rpx solid #008FD6;
  154. border-radius: 100rpx;
  155. }
  156. .right_button {
  157. width: 160rpx;
  158. }
  159. .placeholder {
  160. height: 40rpx;
  161. }
  162. .item-box {
  163. position: relative;
  164. box-shadow: 5rpx 5rpx 5px 0 rgba(0, 0, 0, 0.2);
  165. }
  166. .main_string {
  167. width: 6rpx;
  168. height: 60%;
  169. border-radius: 100rpx;
  170. position: absolute;
  171. top: calc(50% - 30%);
  172. left: 0;
  173. }
  174. button::after {
  175. border: none;
  176. }
  177. .item-img {
  178. width: 160rpx;
  179. height: 160rpx;
  180. }
  181. .item-img-box {
  182. width: 160rpx;
  183. height: 160rpx;
  184. position: relative;
  185. }
  186. .proportion-box {
  187. position: absolute;
  188. bottom: 10rpx;
  189. right: 10rpx;
  190. padding: 4rpx 12rpx;
  191. color: #fff;
  192. border-radius: 10rpx;
  193. font-size: 20rpx;
  194. }
  195. .max-w-80 {
  196. max-width: 398rpx;
  197. }
  198. .max-w-60 {
  199. max-width: 60%;
  200. }
  201. .point {}
  202. </style>