洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

152 lines
3.5 KiB

7 months ago
7 months ago
7 months ago
7 months ago
  1. <template>
  2. <view class="pageBg">
  3. <view class="topBg">
  4. <topNavbar title="投诉咨询记录"></topNavbar>
  5. <view class="tabs">
  6. <view class="tab" v-for="(item,index) in tabList" :key="index" :class="{active: params.type==item.id}" @click="changeTab(item)">{{ item.text }}</view>
  7. </view>
  8. <view class="navs">
  9. <view class="nav" v-for="(item,index) in navList" :key="index" :class="{active: params.dealStatus==item.id}" @click="changeNav(item)">{{ item.text }}</view>
  10. </view>
  11. <view class="recordTotal" v-if="total">{{ total }}条记录</view>
  12. <view class="tabCon" v-if="params.type==1">
  13. <view class="card" v-for="(item,index) in list" :key="index">
  14. <consultItem :item="item" @closeFn="initList"></consultItem>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="pad">
  19. <view class="tabCon" v-if="params.type==2">
  20. <view class="card" v-for="(item,index) in list" :key="index">
  21. <complaintItem :item="item" @closeFn="initList"></complaintItem>
  22. </view>
  23. </view>
  24. </view>
  25. <view style="padding-bottom: 20rpx;" v-if="list.length">
  26. <u-loadmore :status="status" />
  27. </view>
  28. <nodata v-if="!list.length&&status=='nomore'"></nodata>
  29. </view>
  30. </template>
  31. <script>
  32. import consultItem from './comp/consultItem'
  33. import complaintItem from './comp/complaintItem'
  34. import { studentComplain } from '@/config/api.js'
  35. export default {
  36. components: { consultItem, complaintItem },
  37. data() {
  38. return {
  39. tabList: [
  40. {text: '我的咨询',id: 1},
  41. {text: '我的投诉',id: 2},
  42. ],
  43. navList: [
  44. {text: '全部', id: 0},
  45. {text: '待处理', id: 1},
  46. {text: '已处理', id: 2},
  47. {text: '已关闭', id: 3},
  48. ],
  49. status: 'loading',
  50. total: 0,
  51. params: {
  52. type: 1,
  53. dealStatus: 0,
  54. pageNo: 1,
  55. pageSize: 20
  56. },
  57. list: []
  58. }
  59. },
  60. onLoad(options) {
  61. if(options.tab) this.params.type = options.tab
  62. this.params.studentPhone = this.vuex_userInfo.phone
  63. this.studentComplainFn()
  64. },
  65. methods: {
  66. changeTab(item) {
  67. this.params.type = item.id
  68. this.initList()
  69. },
  70. changeNav(item) {
  71. this.params.dealStatus = item.id
  72. this.initList()
  73. },
  74. initList() {
  75. this.params.pageNo = 1
  76. this.list = []
  77. this.status = 'loading'
  78. this.studentComplainFn()
  79. },
  80. // 列表
  81. async studentComplainFn() {
  82. const {data: res} = await studentComplain(this.params)
  83. this.list.push(...res.list)
  84. this.total = res.total
  85. if(this.list.length>=this.total) this.status = 'nomore'
  86. console.log(res)
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .card {
  93. padding: 0 24rpx;
  94. margin-bottom: 20rpx;
  95. }
  96. .topBg {
  97. width: 100%;
  98. padding: 0 28rpx 20rpx 28rpx;
  99. }
  100. .tabs {
  101. display: flex;
  102. width: 100%;
  103. height: 72rpx;
  104. background: #FFFFFF;
  105. border-radius: 16rpx;
  106. .tab {
  107. flex: 1;
  108. text-align: center;
  109. line-height: 72rpx;
  110. color: #ADADAD;
  111. &.active {
  112. background: rgba(25,137,250,0.1);
  113. border-radius: 16rpx;
  114. border: 2rpx solid #1989FA;
  115. color: $themC;
  116. font-weight: 600;
  117. }
  118. }
  119. }
  120. .navs {
  121. display: flex;
  122. justify-content: space-between;
  123. color: #fff;
  124. font-size: 28rpx;
  125. padding: 24rpx 24rpx 40rpx 24rpx;
  126. color: #fff;
  127. .nav {
  128. &.active {
  129. font-weight: 500;
  130. position: relative;
  131. &::before {
  132. position: absolute;
  133. left: 50%;
  134. transform: translateX(-50%);
  135. bottom: -20rpx;
  136. content: '';
  137. width: 56rpx;
  138. height: 6rpx;
  139. background: #FFFFFF;
  140. border-radius: 3rpx;
  141. }
  142. }
  143. }
  144. }
  145. .recordTotal {
  146. font-size: 24rpx;
  147. padding: 28rpx 0 28rpx 0;
  148. text-align: right;
  149. }
  150. </style>