list-item.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. uni.navigateTo({
  48. url: '/pages/mission-details/mission-details'
  49. });
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="less">
  55. .mission-list-item {
  56. margin-bottom: 25rpx;
  57. overflow: hidden;
  58. .time {
  59. height: 47.5rpx;
  60. line-height: 45rpx;
  61. padding-left: 25rpx;
  62. }
  63. .card {
  64. position: relative;
  65. display: flex;
  66. flex-direction: column;
  67. height: 203.75rpx;
  68. background-color: #fff;
  69. padding: 0 25rpx;
  70. .top-box {
  71. display: flex;
  72. flex-direction: column;
  73. justify-content: space-between;
  74. flex: 1;
  75. margin-top: 35rpx;
  76. margin-bottom: 28.12rpx;
  77. }
  78. .title {
  79. line-height: 45rpx;
  80. font-size: 25rpx;
  81. font-weight: bold;
  82. color: #292C33;
  83. }
  84. .row {
  85. display: flex;
  86. align-items: center;
  87. .col {
  88. display: flex;
  89. align-items: center;
  90. height: 20rpx;
  91. &:first-child {
  92. margin-right: 50rpx;
  93. }
  94. .com-icon {
  95. margin-right: 9.37rpx;
  96. width: 20rpx;
  97. height: 20rpx;
  98. }
  99. }
  100. }
  101. .bottom-box {
  102. display: flex;
  103. justify-content: space-between;
  104. align-items: center;
  105. height: 70rpx;
  106. border-top: 0.62rpx solid #DADEE6;
  107. }
  108. .bg-box {
  109. position: absolute;
  110. top: 0;
  111. right: 0;
  112. width: 112.5rpx;
  113. height: 35rpx;
  114. background-size: 100% 100%;
  115. padding-left: 12.5rpx;
  116. text-align: center;
  117. >text {
  118. line-height: 35rpx;
  119. font-size: 17.5rpx;
  120. color: #fff;
  121. }
  122. }
  123. .hight-bg {
  124. background-image: url('~@/static/hight-bg.png');
  125. }
  126. .disabled-bg {
  127. background-image: url('~@/static/disabled-bg.png');
  128. }
  129. }
  130. .com-text {
  131. font-size: 22.5rpx;
  132. color: #666F80;
  133. }
  134. }
  135. </style>