FeedbackList.vue 3.5 KB

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