apply-item.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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. <text v-if="item.dealStatus === 'complete'" class="font-sm text-disable"
  26. style="margin-left: auto;">支付状态:{{getPayStatus(item.payStatus)}}</text>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script setup>
  32. import {
  33. computed
  34. } from 'vue'
  35. import {
  36. getDict
  37. } from '@/common/status/index.js'
  38. const emit = defineEmits(['tapItem'])
  39. const props = defineProps({
  40. item: {
  41. type: Object,
  42. default () {
  43. return {
  44. personName: '张三🤩', //申请人姓名
  45. careNeeds: 'sdasad', //护理需求详情
  46. applyDate: '2025-01-01 12:23:12', //申请日期
  47. status: 1, //申请状态
  48. dealStatus: 1, //处理状态
  49. }
  50. }
  51. },
  52. })
  53. // 获取支付状态
  54. const getPayStatus = (status) => {
  55. if (status === 'dis_pay') {
  56. return '未支付'
  57. } else {
  58. return '已支付'
  59. }
  60. }
  61. const tapItemHandle = () => {
  62. emit('tapItem', props.item)
  63. }
  64. const statusText = computed(() => {
  65. // console.log('???', props.item);
  66. if (props.item.dealStatus === 'complete') return '已完成';
  67. let dict = getDict({
  68. dictValue: props.item.status,
  69. dictType: 'care_apply_status'
  70. });
  71. return dict.dictLabel ?? '空状态';
  72. })
  73. </script>
  74. <style lang="scss" scoped>
  75. :deep(.u-image) {
  76. display: flex;
  77. align-items: center;
  78. justify-content: center;
  79. }
  80. .apply-item {
  81. position: relative;
  82. background-color: #fff;
  83. margin: 24rpx;
  84. padding: 30rpx;
  85. border-radius: 20rpx;
  86. &-tag {
  87. position: absolute;
  88. right: 0;
  89. top: 0;
  90. font-size: 28rpx;
  91. color: #FFFFFF;
  92. background: linear-gradient(to right, #00D885 0%, #2CEFA4 100%);
  93. padding: 6rpx 24rpx;
  94. border-radius: 0 20rpx 0 20rpx;
  95. font-weight: 500;
  96. }
  97. &-tag1,
  98. &-tagno_start {
  99. background: linear-gradient(to right, #EFEFEF 0%, #EFEFEF 100%);
  100. color: #888888;
  101. }
  102. &-tag2,
  103. &-tagin_progress {
  104. background: linear-gradient(to right, #1677FF 0%, #5EA0FB 100%);
  105. }
  106. &-tag0,
  107. &-tagin_disagree {
  108. background: linear-gradient(to right, #fa3534 0%, #fa6355 100%);
  109. }
  110. &-name {
  111. font-size: 32rpx;
  112. color: #222222;
  113. margin-left: 20rpx;
  114. }
  115. &-content {
  116. margin-top: 20rpx;
  117. }
  118. &-tips {
  119. margin-left: 15rpx;
  120. font-size: 28rpx;
  121. color: #444444;
  122. }
  123. &-tips1 {
  124. margin-left: 15rpx;
  125. font-size: 24rpx;
  126. color: #444444;
  127. }
  128. }
  129. </style>