help.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <!-- 直播带货列表 -->
  3. <view class="container">
  4. <view class="rnwdList">
  5. <view class="list" @tap="goDetails(item.id)" v-for="(item, index1) in dataSource" :key="index1">
  6. <span class="listTitle">{{ item.titleName }}</span>
  7. <view class="onePic" v-if="item.pictureList != null && item.pictureList.length == 1">
  8. <image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
  9. </image>
  10. </view>
  11. <view class="twoPic" v-if="item.pictureList != null && item.pictureList.length == 2">
  12. <image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
  13. </image>
  14. </view>
  15. <view class="threePic" v-if="item.pictureList != null && item.pictureList.length == 3">
  16. <image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList" :key="index2">
  17. </image>
  18. </view>
  19. <view class="threePic" v-if="item.pictureList != null && item.pictureList.length > 3">
  20. <image :src="loadImgSrcLocalhost(item2)" v-for="(item2, index2) in item.pictureList"
  21. v-if="index2 < 3" :key="index2"></image>
  22. </view>
  23. <view class="jlSj" style="height: 2vh;display: flex;margin-top: 10px;">
  24. <span style="color: #07c160;font-size: 24rpx;">
  25. {{ item.createTime }}
  26. <!-- <em class="iconfont icon-jifen"></em> -->
  27. </span>
  28. <view class="ck">
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. import {
  35. list
  36. } from '@/api/help/help.js';
  37. export default {
  38. data() {
  39. return {
  40. dataSource: [],
  41. // 数据总量
  42. total: 0,
  43. queryParams: {
  44. // 当前页
  45. pageNum: 1,
  46. // 每页数据量
  47. pageSize: 10,
  48. },
  49. loading: false,
  50. }
  51. },
  52. /**
  53. * 生命周期函数--监听页面加载
  54. */
  55. onLoad(options) {
  56. this.getList(1)
  57. },
  58. onReachBottom(){
  59. let pageNum = this.queryParams.pageNum
  60. let pageSize = this.queryParams.pageSize
  61. let total = this.total
  62. if(pageNum * pageSize >= total){
  63. uni.showToast({
  64. title:'暂无更多数据'
  65. })
  66. return
  67. } else {
  68. this.queryParams.pageNum += 1;
  69. this.getList()
  70. }
  71. },
  72. methods: {
  73. goDetails(id) {
  74. uni.navigateTo({
  75. url: '/pages/highServer/helpDetail/helpDetails?id=' + id,
  76. });
  77. },
  78. // 分页触发
  79. change(e) {
  80. this.getList(e.current);
  81. },
  82. // 获取数据
  83. getList(pageNum) {
  84. let params = {
  85. pageSize: this.queryParams.pageSize,
  86. pageNum: pageNum,
  87. }
  88. list(params).then(res => {
  89. if (res.code == 200) {
  90. this.dataSource = [...this.dataSource,...res.rows]
  91. this.total = res.total
  92. }
  93. })
  94. },
  95. }
  96. }
  97. </script>
  98. <style>
  99. @import './help.css';
  100. </style>