list-item.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <template>
  2. <view class="mission-list-item" @click="gotoDetails">
  3. <view v-if="!isComplete" class="time">
  4. <text class="com-text">{{ task.recordTime }}</text>
  5. </view>
  6. <view class="card">
  7. <view class="top-box">
  8. <view :class="['bg-box', isComplete ? 'disabled-bg' : 'hight-bg']">
  9. <text>{{isComplete ? '改善结案' : '改善中'}}</text>
  10. </view>
  11. <text class="title">{{ task.checkPointName }}</text>
  12. <view class="row">
  13. <view class="col">
  14. <image class="com-icon" src="/static/search-icon.png"></image>
  15. <text class="com-text">{{ task.checkPlan }}</text>
  16. </view>
  17. <view class="col">
  18. <image class="com-icon" src="/static/location-icon.png"></image>
  19. <text class="com-text">{{ task.deptName }}</text>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="bottom-box">
  24. <text class="com-text">情境名称:{{ task.situationName }}</text>
  25. <text class="com-text">改善人:{{ task.improveEmpName }}</text>
  26. </view>
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. export default {
  32. props: {
  33. // 当前遍历的任务
  34. task: {
  35. type: Object,
  36. default: () => {
  37. return {}
  38. }
  39. },
  40. // 是否结案
  41. isComplete: {
  42. type: Boolean,
  43. default: false
  44. }
  45. },
  46. computed: {
  47. bgImage(){
  48. console.log(`url(~@/static/${!this.isComplete ? 'hight' : 'disabled'}-bg.png)`)
  49. return `../../../static/${!this.isComplete ? 'hight' : 'disabled'}-bg.png`;
  50. }
  51. },
  52. methods: {
  53. // 跳转详情页面(改善任务)
  54. gotoDetails(){
  55. uni.navigateTo({
  56. url: '/pages/mission-details/mission-details'
  57. });
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="less">
  63. .mission-list-item {
  64. margin-bottom: 25rpx;
  65. overflow: hidden;
  66. .time {
  67. height: 47.5rpx;
  68. line-height: 45rpx;
  69. padding-left: 25rpx;
  70. }
  71. .card {
  72. position: relative;
  73. display: flex;
  74. flex-direction: column;
  75. height: 203.75rpx;
  76. background-color: #fff;
  77. padding: 0 25rpx;
  78. .top-box {
  79. display: flex;
  80. flex-direction: column;
  81. justify-content: space-between;
  82. flex: 1;
  83. margin-top: 35rpx;
  84. margin-bottom: 28.12rpx;
  85. }
  86. .title {
  87. line-height: 45rpx;
  88. font-size: 25rpx;
  89. font-weight: bold;
  90. color: #292C33;
  91. }
  92. .row {
  93. display: flex;
  94. align-items: center;
  95. .col {
  96. display: flex;
  97. align-items: center;
  98. height: 20rpx;
  99. &:first-child {
  100. margin-right: 50rpx;
  101. }
  102. .com-icon {
  103. margin-right: 9.37rpx;
  104. width: 20rpx;
  105. height: 20rpx;
  106. }
  107. }
  108. }
  109. .bottom-box {
  110. display: flex;
  111. justify-content: space-between;
  112. align-items: center;
  113. height: 70rpx;
  114. border-top: 0.62rpx solid #DADEE6;
  115. }
  116. .bg-box {
  117. position: absolute;
  118. top: 0;
  119. right: 0;
  120. width: 112.5rpx;
  121. height: 35rpx;
  122. background-size: 100% 100%;
  123. padding-left: 12.5rpx;
  124. text-align: center;
  125. >text {
  126. line-height: 35rpx;
  127. font-size: 17.5rpx;
  128. color: #fff;
  129. }
  130. }
  131. .hight-bg {
  132. background-image: url('~@/static/hight-bg.png');
  133. }
  134. .disabled-bg {
  135. background-image: url('~@/static/disabled-bg.png');
  136. }
  137. }
  138. .com-text {
  139. font-size: 22.5rpx;
  140. color: #666F80;
  141. }
  142. }
  143. </style>