洛阳学员端
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.

153 lines
3.6 KiB

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