list.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <template>
  2. <view class="feedback-list" :style="viewColor">
  3. <block v-for="(item,index) in list" :key="index">
  4. <view class="item" @click="goDetail(item)">
  5. <view class="info">
  6. <text class="tips">{{item.type.cate_name}}</text>
  7. <view class="title line1">{{item.content}}</view>
  8. </view>
  9. <view class="time">{{item.create_time}}</view>
  10. <view class="iconfont icon-xiangyou"></view>
  11. </view>
  12. </block>
  13. <block v-if="list.length == 0">
  14. <emptyPage title="暂无数据"></emptyPage>
  15. </block>
  16. </view>
  17. </template>
  18. <script>
  19. // +----------------------------------------------------------------------
  20. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  21. // +----------------------------------------------------------------------
  22. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  23. // +----------------------------------------------------------------------
  24. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  25. // +----------------------------------------------------------------------
  26. // | Author: CRMEB Team <admin@crmeb.com>
  27. // +----------------------------------------------------------------------
  28. import emptyPage from '@/components/emptyPage.vue'
  29. import { feedbackList } from '@/api/user.js'
  30. import { mapGetters } from "vuex";
  31. export default {
  32. components:{
  33. emptyPage
  34. },
  35. computed: mapGetters(['viewColor']),
  36. data(){
  37. return {
  38. list:[],
  39. page:1,
  40. limit:10,
  41. isScroll:true
  42. }
  43. },
  44. onLoad() {
  45. this.getList()
  46. },
  47. methods:{
  48. getList(){
  49. if(!this.isScroll) return
  50. feedbackList({
  51. page:this.page,
  52. limit:this.limit
  53. }).then(({data})=>{
  54. this.isScroll = data.list.length>=this.limit
  55. this.list = this.list.concat(data.list)
  56. this.page+=1
  57. })
  58. },
  59. // 详情
  60. goDetail(item){
  61. uni.navigateTo({
  62. url:'/pages/users/feedback/detail?id='+item.feedback_id
  63. })
  64. }
  65. },
  66. onReachBottom() {
  67. this.getList()
  68. }
  69. }
  70. </script>
  71. <style lang="scss">
  72. .feedback-list{
  73. .item{
  74. position: relative;
  75. padding: 20rpx 30rpx;
  76. background-color: #fff;
  77. border-bottom: 1px solid #f5f5f5;
  78. .info{
  79. display: flex;
  80. align-items: center;
  81. font-size: 28rpx;
  82. color: #666;
  83. .title{
  84. flex: 1;
  85. padding-right: 30rpx;
  86. }
  87. .tips{
  88. margin-right: 10rpx;
  89. color: var(--view-theme);
  90. }
  91. }
  92. .time{
  93. margin-top: 5rpx;
  94. color: #BBBBBB;
  95. font-size: 26rpx;
  96. }
  97. .iconfont{
  98. position: absolute;
  99. right: 20rpx;
  100. top: 50%;
  101. transform: translateY(-50%);
  102. font-size: 26rpx;
  103. color: #707070;
  104. }
  105. }
  106. }
  107. </style>