commonproblem.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <template>
  2. <view class="commonproblem">
  3. <navbar ref="navbar" :config="config" backColor="#fff"></navbar>
  4. <view v-if="problemList.length>=0">
  5. <view class="item" v-for="(item,index) in problemList">
  6. <view class="top">
  7. <view class="left">
  8. </view>
  9. <view class="right" >
  10. {{item.title}}
  11. </view>
  12. </view>
  13. <view class="content">
  14. {{item.content}}
  15. </view>
  16. </view>
  17. <loadMore v-if="problemList.length>0" :status="status"></loadMore>
  18. </view>
  19. <nodata v-else :config="{ top: 15, content: '暂无数据~' }"></nodata>
  20. </view>
  21. </template>
  22. <script>
  23. export default{
  24. data(){
  25. return{
  26. config: {
  27. back: true, //false是tolbar页面 是则不写
  28. title: '常见问题',
  29. color: '#fff',
  30. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  31. backgroundColor: [1, "#3775F6"],
  32. statusBarFontColor: '#1A1A1A',
  33. },
  34. params:{
  35. page:1,
  36. limit:10,
  37. },
  38. problemList:[],
  39. status:'more',
  40. noData:false
  41. }
  42. },
  43. //下拉刷新
  44. onPullDownRefresh() {
  45. this.params.page= 1,
  46. this.problemList = []
  47. this.getMsg()
  48. },
  49. //上拉加载
  50. onReachBottom(e){
  51. this.status='loading'
  52. this.params.page++
  53. this.getMsg()
  54. },
  55. onLoad() {
  56. this.getMsg()
  57. },
  58. methods:{
  59. getMsg(){
  60. this.$http.get("/sys/faq/pages",this.params).then(res=>{
  61. if(res&&res.code==200){
  62. uni.stopPullDownRefresh()
  63. // this.problemList = res.page.list
  64. this.problemList = this.problemList.concat(res.page.list)
  65. if(res.page.totalPage<=res.page.currPage){
  66. this.status = 'noMore'
  67. }else{
  68. this.status = "more"
  69. }
  70. }
  71. })
  72. }
  73. }
  74. }
  75. </script>
  76. <style lang="scss" scoped>
  77. .bottom{
  78. padding: 28rpx 40rpx 28rpx 40rpx;
  79. .top{
  80. display: flex;
  81. align-items: center;
  82. .left{
  83. width: 8rpx;
  84. height: 8rpx;
  85. background-color: #050505;
  86. border-radius: 50%;
  87. }
  88. .right{
  89. flex: 1;
  90. margin-left: 14rpx;
  91. font-size: 28rpx;
  92. font-weight: Regular;
  93. line-height: 40rpx;
  94. color: #050505;
  95. }
  96. }
  97. .content{
  98. margin-left: 14rpx;
  99. font-size: 22rpx;
  100. font-weight: Regular;
  101. color: #8C888C;
  102. line-height: 40rpx;
  103. }
  104. }
  105. .item{
  106. padding: 28rpx 40rpx 28rpx 40rpx;
  107. .top{
  108. display: flex;
  109. align-items: center;
  110. }
  111. .content{
  112. width: 100%;
  113. margin-left: 14rpx;
  114. font-size: 22rpx;
  115. font-weight: Regular;
  116. color: #8C888C;
  117. line-height: 40rpx;
  118. word-break: break-all;
  119. white-space: pre-wrap;
  120. }
  121. .left{
  122. width: 8rpx;
  123. height: 8rpx;
  124. background-color: #050505;
  125. border-radius: 50%;
  126. }
  127. .right{
  128. flex: 1;
  129. margin-left: 14rpx;
  130. font-size: 28rpx;
  131. font-weight: Regular;
  132. line-height: 40rpx;
  133. color: #050505;
  134. }
  135. }
  136. </style>