list-item.vue 3.1 KB

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