FeedbackList.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. padding: 32rpx 40rpx 0rpx;
  64. background-color: #F6F7F8;
  65. .loop-list-item {
  66. min-height: 200rpx;
  67. margin-bottom: 24rpx;
  68. border-radius: 10rpx;
  69. background: #fff;
  70. padding: 14rpx 0 20rpx;
  71. .item-content {
  72. .item-title{
  73. padding: 0 20rpx;
  74. display: flex;
  75. justify-content: space-between;
  76. align-items: center;
  77. .title-line {
  78. font-weight: 600;
  79. font-size: 28rpx;
  80. color: #363A44;
  81. }
  82. .title-company {
  83. padding: 12rpx 20rpx;
  84. border-radius: 8rpx;
  85. font-size: 24rpx;
  86. &.yellow {
  87. background-color: #FEF6ED;
  88. color: #FD9F48;
  89. }
  90. &.blue {
  91. background-color: #EDF2FD;
  92. color: #1E92F0;
  93. }
  94. &.green {
  95. background-color: #E8F7F1;
  96. color: #00B578;
  97. }
  98. }
  99. }
  100. .part-line {
  101. border-top: 1px solid #EFEFEF;
  102. margin: 10rpx 0 20rpx;
  103. }
  104. .text-content {
  105. padding: 0 20rpx;
  106. display: flex;
  107. flex-direction: column;
  108. .other-loop-item {
  109. margin-bottom: 10rpx;
  110. display: flex;
  111. align-items: center;
  112. font-size: 28rpx;
  113. font-weight: 400;
  114. .textTitle {
  115. color: #9B9B9B;
  116. margin-right: 24rpx;
  117. }
  118. .textValue {
  119. color: #363A44;
  120. }
  121. &:last-child {
  122. margin-bottom: 0;
  123. }
  124. }
  125. }
  126. }
  127. }
  128. }
  129. ::v-deep .scroll-view {
  130. height: calc(100%);
  131. background-color: transparent !important;
  132. }
  133. ::v-deep .no-data {
  134. margin-top: 0;
  135. padding-top: 160rpx;
  136. }
  137. }
  138. </style>