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

113 lines
2.9 KiB

7 months ago
7 months ago
  1. <template>
  2. <view class="pageBgImg">
  3. <topNavbar title="咨询投诉"></topNavbar>
  4. <view class="pad">
  5. <view class="card">
  6. <view class="tabBox">
  7. <view class="tab" v-for="(item,index) in tabArr" :key="index" @click="goPage(item)">
  8. <view class="icon">
  9. <image :src="item.icon" mode=""></image>
  10. </view>
  11. <view class="text">{{item.text}}</view>
  12. </view>
  13. </view>
  14. </view>
  15. <view class="question">
  16. <view class="h1">常见问题</view>
  17. <view class="card que">
  18. <u-collapse :body-style="itemStyle" :border="false">
  19. <u-collapse-item :title="item.question" v-for="(item, index) in itemList" :key="index" style="border-bottom: 1rpx solid #E8E9EC;">
  20. <text style=" color: #999;">{{item.answer}}</text>
  21. <!-- {{item.answer}} -->
  22. </u-collapse-item>
  23. </u-collapse>
  24. </view>
  25. </view>
  26. </view>
  27. <view style="padding: 20rpx 0;" v-if="itemList.length">
  28. <u-loadmore :status="status" />
  29. </view>
  30. <nodata v-if="!itemList.length&&status=='nomore'"></nodata>
  31. </view>
  32. </template>
  33. <script>
  34. import { askedQuestion } from '@/config/api.js'
  35. export default {
  36. data() {
  37. return {
  38. itemStyle: {
  39. marginLeft:'20rpx',
  40. },
  41. itemList: [],
  42. tabArr: [
  43. {text: '我要咨询', icon: require('../../../static/images/index/ic_zixun.png'), url:'/pages/indexEntry/consult/pubConsult/pubConsult', id: 1},
  44. {text: '我要投诉', icon: require('../../../static/images/index/ic_tousu.png'), url: '/pages/indexEntry/consult/pubComplaint/pubComplaint', id: 2,},
  45. {text: '查看记录', icon: require('../../../static/images/index/ic_jilu.png'), url: '/pages/indexEntry/consult/record/record', id: 3},
  46. ],
  47. params: {
  48. pageNo: 1,
  49. pageSize: 20
  50. },
  51. status: 'loading'
  52. }
  53. },
  54. onLoad() {
  55. this.askedQuestionFn()
  56. },
  57. onPullDownRefresh() {
  58. this.params.pageNo = 1
  59. this.itemList = []
  60. this.askedQuestionFn().then(()=>{ uni.stopPullDownRefresh()})
  61. },
  62. methods: {
  63. goPage(item) {
  64. if(item.text=='我要投诉') {
  65. if(this.vuex_userInfo.applyStep!=6) {
  66. return this.$u.toast('只有报名成功的学员才能投诉')
  67. }
  68. }
  69. this.$goPage(item.url)
  70. },
  71. async askedQuestionFn() {
  72. const {data: res} = await askedQuestion(this.params)
  73. this.params.pageNo ++
  74. this.itemList.push(...res.list)
  75. this.total = res.total
  76. if(this.itemList.length>=this.total) {
  77. this.status = 'nomore'
  78. }else {
  79. this.status = 'loadmore'
  80. }
  81. }
  82. }
  83. }
  84. </script>
  85. <style lang="scss" scoped>
  86. .tabBox {
  87. display: flex;
  88. // margin-top: 20rpx;
  89. height: 192rpx;
  90. .tab {
  91. flex: 1;
  92. display: flex;
  93. flex-direction: column;
  94. align-items: center;
  95. justify-content: center;
  96. .icon {
  97. width: 72rpx;
  98. height: 72rpx;
  99. }
  100. .text {
  101. font-size: 28rpx;
  102. margin-top: 18rpx;
  103. }
  104. }
  105. }
  106. .h1 {
  107. line-height: 100rpx;
  108. }
  109. .que {
  110. padding: 28rpx;
  111. }
  112. </style>