task-item.vue 4.6 KB

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