myPayKnow.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <!-- pages/fuwu/fuwu.wxml -->
  3. <!-- 付费知识 -->
  4. <view class="container">
  5. <view class="rnwdList">
  6. <view class="list" @tap="goDetails(item)" v-for="(item, index1) in wb" :key="index1">
  7. <span class="lb">{{ item.popular == '1' ? '热门' : '非热门' }}</span>
  8. <span class="listTitle">{{ item.titleName }}</span>
  9. <view class="onePic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 1">
  10. <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
  11. </image>
  12. </view>
  13. <view class="twoPic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 2">
  14. <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
  15. </image>
  16. </view>
  17. <view class="threePic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 3">
  18. <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
  19. </image>
  20. </view>
  21. <view class="jlSj">
  22. <span style="color: #07c160;font-size: 24rpx;">
  23. {{ item.createTime }}
  24. <!-- <em class="iconfont icon-jifen"></em> -->
  25. </span>
  26. <view class="ck">
  27. <span class="jf">
  28. {{ item.integral }}
  29. <em class="iconfont icon-jifen"></em>
  30. </span>
  31. <span>
  32. <em class="iconfont icon-shoucang"></em>
  33. {{ item.watchNum }}
  34. </span>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. import {
  43. myPayKnow
  44. } from '@/api/me/me.js'
  45. export default {
  46. data() {
  47. return {
  48. query: {
  49. pageSize: 10,
  50. pageNum: 1,
  51. createId: null
  52. },
  53. wb: [],
  54. total: 0
  55. };
  56. }
  57. /**
  58. * 生命周期函数--监听页面加载
  59. */
  60. ,
  61. onReachBottom() {
  62. let pageNum = this.query.pageNum
  63. let pageSize = this.query.pageSize
  64. let total = this.total
  65. if (pageNum * pageSize >= total) {
  66. uni.showToast({
  67. title: '暂无更多数据'
  68. })
  69. return
  70. } else {
  71. this.query.pageNum += 1;
  72. this.getlist()
  73. }
  74. },
  75. // 下拉刷新
  76. onPullDownRefresh() {
  77. setTimeout(() => {
  78. this.query.pageNum = 1;
  79. this.wb = [];
  80. this.getlist()
  81. }, 500)
  82. },
  83. onLoad(options) {
  84. this.query.createId = getApp().globalData.userId
  85. // this.query.createId = '1763382026214764546'
  86. this.getlist()
  87. },
  88. methods: {
  89. getlist() {
  90. myPayKnow(this.query).then(res => {
  91. this.wb = [...this.wb, ...res.rows]
  92. this.total = res.total
  93. uni.showToast({
  94. title: `加载成功`
  95. })
  96. })
  97. },
  98. goSanNong() {
  99. uni.navigateTo({
  100. url: '/pages/demo/sannong/sannong'
  101. });
  102. },
  103. goDetails(item) {
  104. if (item == null) return;
  105. uni.navigateTo({
  106. url: '/pages/highServer/knowledgeDetails/knowledgeDetails?id=' + item.id,
  107. });
  108. }
  109. }
  110. };
  111. </script>
  112. <style>
  113. @import 'myPayKnow.css';
  114. </style>