FeedbackList.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <view class="feedback-list-view">
  3. <pub-list-scroll ref="pubListScrollRef" @next="onScrollTolower" :loaded="loaded" :text="loadText" :status="status">
  4. <view class="no-data" v-if="!listArray || listArray.length == 0">
  5. <image mode="heightFix" src="/static/image/no-data.png" />
  6. 暂无数据
  7. </view>
  8. <view class="feedback-list" v-else>
  9. <view v-for="(item,index) in listArray" :key="index" class="loop-list-item" @click="onClick(item)">
  10. <view class="item-content">
  11. <view class="item-title">
  12. <view class="title-line">{{ filterApplicationType(item.fklx) }}</view>
  13. <view class="title-company" :class="filterApplicationBgColor(item.fkzt)">{{ filterApplicationStatus(item.fkzt) }}</view>
  14. </view>
  15. <view class="part-line"></view>
  16. <view class="text-content">
  17. <view v-for="(textItem,textIndex) in item.formattedData" :key="textIndex" class="other-loop-item">
  18. <view class="textTitle">{{ textItem.title }}</view>
  19. <view class="textValue">{{ textItem.value }}</view>
  20. </view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </pub-list-scroll>
  26. </view>
  27. </template>
  28. <script setup lang="ts">
  29. import { defineProps,ref } from "vue";
  30. import {
  31. filterApplicationStatus,
  32. filterApplicationType,
  33. filterApplicationBgColor,
  34. } from '@/lib/util'
  35. const emit = defineEmits(['click','nextPage']) // 定义 success 事件,用于操作成功后的回调
  36. // 定义 props 类型
  37. const props = defineProps({
  38. listArray: {
  39. type: Object,
  40. default: () => {}
  41. },
  42. status: {
  43. type: String,
  44. default: "loading"
  45. }
  46. });
  47. const pubListScrollRef = ref(null)
  48. const loaded = ref(false)
  49. const loadText = ref('数据加载中...')
  50. const onScrollTolower = ()=> {
  51. console.log("下一页了?")
  52. emit("nextPage")
  53. }
  54. const onClick = (item:any)=> {
  55. emit("click",item)
  56. }
  57. </script>
  58. <style lang="scss">
  59. .feedback-list-view {
  60. background-color: #F6F7F8;
  61. height: 100%;
  62. .feedback-list {
  63. height: 100%;
  64. padding: 32rpx 40rpx 40rpx;
  65. background-color: #F6F7F8;
  66. .loop-list-item {
  67. min-height: 200rpx;
  68. margin-bottom: 24rpx;
  69. border-radius: 10rpx;
  70. background: #fff;
  71. padding: 14rpx 0 20rpx;
  72. .item-content {
  73. .item-title{
  74. padding: 0 20rpx;
  75. display: flex;
  76. justify-content: space-between;
  77. align-items: center;
  78. .title-line {
  79. font-weight: 600;
  80. font-size: 28rpx;
  81. color: #363A44;
  82. }
  83. .title-company {
  84. padding: 12rpx 20rpx;
  85. border-radius: 8rpx;
  86. font-size: 24rpx;
  87. &.yellow {
  88. background-color: #FEF6ED;
  89. color: #FD9F48;
  90. }
  91. &.blue {
  92. background-color: #EDF2FD;
  93. color: #1E92F0;
  94. }
  95. &.green {
  96. background-color: #E8F7F1;
  97. color: #00B578;
  98. }
  99. }
  100. }
  101. .part-line {
  102. width: 100%;
  103. border: 1px solid #EFEFEF;
  104. margin: 10rpx 0 20rpx;
  105. }
  106. .text-content {
  107. padding: 0 20rpx;
  108. display: flex;
  109. flex-direction: column;
  110. .other-loop-item {
  111. margin-bottom: 10rpx;
  112. display: flex;
  113. align-items: center;
  114. font-size: 28rpx;
  115. font-weight: 400;
  116. .textTitle {
  117. color: #9B9B9B;
  118. margin-right: 24rpx;
  119. }
  120. .textValue {
  121. color: #363A44;
  122. }
  123. &:last-child {
  124. margin-bottom: 0;
  125. }
  126. }
  127. }
  128. }
  129. }
  130. }
  131. ::v-deep .scroll-view {
  132. height: calc(100%);
  133. background-color: transparent !important;
  134. }
  135. ::v-deep .no-data {
  136. margin-top: 0;
  137. padding-top: 160rpx;
  138. }
  139. }
  140. </style>