学员端小程序
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.

146 lines
3.3 KiB

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