apply-item.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <view class="apply-item" @tap="tapItemHandle">
  3. <view class="apply-item-tag" :class="[`apply-item-tag${item.dealStatus??1}`]">{{statusText}}</view>
  4. <view class="flex-row">
  5. <u-image class="apply-item-image1" width="51.2rpx" height="51.2rpx" bgColor="transparent"
  6. src="@/pages/subpack/static/images/app/avatar-mini.png" />
  7. <view class="apply-item-name">{{item.personName}}</view>
  8. </view>
  9. <view class="apply-item-content">
  10. <view class="flex-row align-center">
  11. <u-image class="apply-item-image2" width="36rpx" height="36rpx" bgColor="transparent"
  12. src="@/pages/subpack/static/images/app/cat-icon.png" />
  13. <view class="apply-item-tips text-overflow">
  14. <text>需求:</text>
  15. <text>{{item.careNeeds??'-'}}</text>
  16. </view>
  17. </view>
  18. <view class="flex-row align-center mt-08">
  19. <u-image class="apply-item-image2" width="36rpx" height="36rpx" bgColor="transparent"
  20. src="@/pages/subpack/static/images/app/time-icon.png" />
  21. <view class="apply-item-tips1">
  22. <text>申请日期:</text>
  23. <text>{{item.applyDate??'-'}}</text>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </template>
  29. <script setup>
  30. import {
  31. computed
  32. } from 'vue'
  33. import {
  34. getDict
  35. } from '@/common/status/index.js'
  36. const emit = defineEmits(['tapItem'])
  37. const props = defineProps({
  38. item: {
  39. type: Object,
  40. default () {
  41. return {
  42. personName: '张三🤩', //申请人姓名
  43. careNeeds: 'sdasad', //护理需求详情
  44. applyDate: '2025-01-01 12:23:12', //申请日期
  45. status: 1, //申请状态
  46. dealStatus: 1, //处理状态
  47. }
  48. }
  49. },
  50. })
  51. const tapItemHandle = () => {
  52. emit('tapItem', props.item)
  53. }
  54. const statusText = computed(() => {
  55. // console.log('???', props.item);
  56. if (props.item.dealStatus === 'complete') return '已完成';
  57. let dict = getDict({
  58. dictValue: props.item.status,
  59. dictType: 'care_apply_status'
  60. });
  61. return dict.dictLabel ?? '空状态';
  62. })
  63. </script>
  64. <style lang="scss" scoped>
  65. :deep(.u-image) {
  66. display: flex;
  67. align-items: center;
  68. justify-content: center;
  69. }
  70. .apply-item {
  71. position: relative;
  72. background-color: #fff;
  73. margin: 24rpx;
  74. padding: 30rpx;
  75. border-radius: 20rpx;
  76. &-tag {
  77. position: absolute;
  78. right: 0;
  79. top: 0;
  80. font-size: 28rpx;
  81. color: #FFFFFF;
  82. background: linear-gradient(to right, #00D885 0%, #2CEFA4 100%);
  83. padding: 6rpx 24rpx;
  84. border-radius: 0 20rpx 0 20rpx;
  85. font-weight: 500;
  86. }
  87. &-tag1,
  88. &-tagno_start {
  89. background: linear-gradient(to right, #EFEFEF 0%, #EFEFEF 100%);
  90. color: #888888;
  91. }
  92. &-tag2,
  93. &-tagin_progress {
  94. background: linear-gradient(to right, #1677FF 0%, #5EA0FB 100%);
  95. }
  96. &-tag0,
  97. &-tagin_disagree {
  98. background: linear-gradient(to right, #fa3534 0%, #fa6355 100%);
  99. }
  100. &-name {
  101. font-size: 32rpx;
  102. color: #222222;
  103. margin-left: 20rpx;
  104. }
  105. &-content {
  106. margin-top: 20rpx;
  107. }
  108. &-tips {
  109. margin-left: 15rpx;
  110. font-size: 28rpx;
  111. color: #444444;
  112. }
  113. &-tips1 {
  114. margin-left: 15rpx;
  115. font-size: 24rpx;
  116. color: #444444;
  117. }
  118. }
  119. </style>