myPayKnow.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. import {
  46. getDetails
  47. } from '@/api/knowledge/knowledge.js';
  48. export default {
  49. data() {
  50. return {
  51. query: {
  52. pageSize: 10,
  53. pageNum: 1,
  54. createId: null
  55. },
  56. wb: [],
  57. total: 0
  58. };
  59. }
  60. /**
  61. * 生命周期函数--监听页面加载
  62. */
  63. ,
  64. onReachBottom() {
  65. let pageNum = this.query.pageNum
  66. let pageSize = this.query.pageSize
  67. let total = this.total
  68. if (pageNum * pageSize >= total) {
  69. uni.showToast({
  70. title: '暂无更多数据'
  71. })
  72. return
  73. } else {
  74. this.query.pageNum += 1;
  75. this.getlist()
  76. }
  77. },
  78. // 下拉刷新
  79. onPullDownRefresh() {
  80. setTimeout(() => {
  81. this.query.pageNum = 1;
  82. this.wb = [];
  83. this.getlist()
  84. }, 500)
  85. },
  86. onLoad(options) {
  87. this.query.createId = getApp().globalData.userId
  88. // this.query.createId = '1763382026214764546'
  89. this.getlist()
  90. },
  91. methods: {
  92. getlist() {
  93. myPayKnow(this.query).then(res => {
  94. this.wb = [...this.wb, ...res.rows]
  95. this.total = res.total
  96. uni.showToast({
  97. title: `加载成功`
  98. })
  99. })
  100. },
  101. goSanNong() {
  102. uni.navigateTo({
  103. url: '/pages/demo/sannong/sannong'
  104. });
  105. },
  106. goDetails(item) {
  107. if (item == null) return;
  108. getDetails(item.id).then(res => {
  109. let data = res.data
  110. data.urls = data.imgUrlList.split(',')
  111. uni.navigateTo({
  112. url: `/pages/common/articleDetail/articleDetail?data=${this.encodify(data)}`
  113. });
  114. })
  115. }
  116. }
  117. };
  118. </script>
  119. <style>
  120. @import 'myPayKnow.css';
  121. </style>