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

147 lines
3.4 KiB

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