helpCenter.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="container">
  3. <!-- <u-navbar title="帮助中心" leftIconColor="#ffffff" titleStyle="color:#fff" :autoBack="true" placeholder></u-navbar> -->
  4. <view class="list">
  5. <view class="item" v-for="(v,i) in list" :key="i" @click="goPath('/pages/mine/agreement?helpId='+v.id)">
  6. <view class="item_l">{{v.problemTitle}}</view>
  7. <view class="item_r"><text class="iconfont icon-jiantou"></text></view>
  8. </view>
  9. <empty marginTop="50" v-if="(!list||list.length<=0)&&status!='loading'"></empty>
  10. <u-loadmore v-else :status="status" />
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. import { problemPage } from "@/api/user.js"
  16. export default {
  17. data () {
  18. return {
  19. status: 'loadmore',//加载前值为loadmore,加载中为loading,没有数据为nomore
  20. params: {
  21. pageSize: 20,
  22. pageNum: 1,
  23. status: 1
  24. },
  25. list: []
  26. }
  27. },
  28. onPullDownRefresh () {
  29. this.params.pageNum = 1;
  30. this.getList();
  31. },
  32. onReachBottom () {
  33. if (this.status == "loadmore") {
  34. this.params.pageNum++;
  35. this.getList()
  36. }
  37. },
  38. onLoad () {
  39. this.getList();
  40. },
  41. methods: {
  42. getList () {
  43. problemPage(this.params).then(res => {
  44. if (this.params.pageNum == 1) {
  45. this.list = res.rows
  46. } else {
  47. this.list.push(...res.rows);
  48. }
  49. if (this.list.length < res.total) {
  50. this.status = 'loadmore';
  51. } else {
  52. this.status = 'nomore';
  53. }
  54. }).finally(()=>{
  55. uni.stopPullDownRefresh();
  56. })
  57. },
  58. goPath (path) {
  59. uni.navigateTo({
  60. url: path
  61. })
  62. },
  63. },
  64. }
  65. </script>
  66. <style lang='scss' scoped>
  67. ::v-deep .u-navbar__content,
  68. ::v-deep .u-status-bar {
  69. background-color: #c90700 !important;
  70. }
  71. .container {
  72. background: #ffffff;
  73. .list {
  74. padding: 15rpx 30rpx;
  75. .item {
  76. display: flex;
  77. justify-content: space-between;
  78. align-items: center;
  79. padding: 35rpx 0 30rpx;
  80. border-bottom: 1rpx solid #e6e6e6;
  81. .item_l {
  82. font-size: 28rpx;
  83. color: #1a1a1a;
  84. white-space: nowrap;
  85. text-overflow: ellipsis;
  86. overflow: hidden;
  87. width: calc(100% - 100rpx);
  88. }
  89. .item_r {
  90. color: #a3a3a3;
  91. }
  92. }
  93. }
  94. }
  95. </style>