financialInfrastructure.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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">
  24. <view class="ck">
  25. <span>
  26. <em class="iconfont icon-chakan"></em>
  27. {{ item.likeNum }}
  28. </span>
  29. <!-- <span>-->
  30. <!-- <em class="iconfont icon-shoucang"></em>-->
  31. <!-- {{ item.watchNum }}-->
  32. <!-- </span>-->
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import { list ,getDetails} from '@/api/specialService/financialInfrastructure.js';
  41. export default {
  42. data() {
  43. return {
  44. dataSource: [],
  45. // 数据总量
  46. total: 0,
  47. queryParams: {
  48. // 当前页
  49. pageNum: 1,
  50. // 每页数据量
  51. pageSize: 10,
  52. },
  53. loading: false,
  54. }
  55. },
  56. /**
  57. * 生命周期函数--监听页面加载
  58. */
  59. onLoad(options) {
  60. this.getList(1)
  61. },
  62. onReachBottom(){
  63. let pageNum = this.queryParams.pageNum
  64. let pageSize = this.queryParams.pageSize
  65. let total = this.total
  66. if(pageNum * pageSize >= total){
  67. uni.showToast({
  68. title:'暂无更多数据'
  69. })
  70. return
  71. } else {
  72. this.queryParams.pageNum += 1;
  73. this.getList(this.queryParams.pageNum)
  74. }
  75. },
  76. methods: {
  77. goDetails(id) {
  78. getDetails(id).then(res => {
  79. let data = res.data
  80. data.urls = data.pictureList
  81. uni.navigateTo({
  82. url: `/pages/common/articleDetail/articleDetail?data=${this.encodify(data)}`
  83. });
  84. })
  85. },
  86. // 分页触发
  87. change(e) {
  88. this.getList(e.current);
  89. },
  90. // 获取数据
  91. getList(pageNum) {
  92. let params = {
  93. pageSize: this.queryParams.pageSize,
  94. pageNum: pageNum,
  95. }
  96. list(params).then(res => {
  97. if (res.code == 200) {
  98. this.dataSource = [...this.dataSource,...res.rows]
  99. this.total = res.total
  100. }
  101. })
  102. },
  103. }
  104. }
  105. </script>
  106. <style>
  107. @import './financialInfrastructure.css';
  108. </style>