123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <template>
- <!-- pages/fuwu/fuwu.wxml -->
- <!-- 付费知识 -->
- <view class="container">
- <view class="rnwdList">
- <view class="list" @tap="goDetails(item)" v-for="(item, index1) in wb" :key="index1">
- <span class="lb">{{ item.popular == '1' ? '热门' : '非热门' }}</span>
- <span class="listTitle">{{ item.titleName }}</span>
- <view class="onePic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 1">
- <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
- </image>
- </view>
- <view class="twoPic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 2">
- <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
- </image>
- </view>
- <view class="threePic" v-if="item.imgUrlList != null && item.imgUrlList.split(',').length == 3">
- <image :src="loadImgSrcLocalhost(itemurl)" v-for="(itemurl, index1) in item.imgUrlList.split(',')" :key="index1">
- </image>
- </view>
- <view class="jlSj">
- <span style="color: #07c160;font-size: 24rpx;">
- {{ item.createTime }}
- <!-- <em class="iconfont icon-jifen"></em> -->
- </span>
- <view class="ck">
- <span class="jf">
- {{ item.integral }}
- <em class="iconfont icon-jifen"></em>
- </span>
- <span>
- <em class="iconfont icon-shoucang"></em>
- {{ item.watchNum }}
- </span>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- myPayKnow
- } from '@/api/me/me.js'
- import {
- getDetails
- } from '@/api/knowledge/knowledge.js';
- export default {
- data() {
- return {
- query: {
- pageSize: 10,
- pageNum: 1,
- createId: null
- },
- wb: [],
- total: 0
- };
- }
- /**
- * 生命周期函数--监听页面加载
- */
- ,
- onReachBottom() {
- let pageNum = this.query.pageNum
- let pageSize = this.query.pageSize
- let total = this.total
- if (pageNum * pageSize >= total) {
- uni.showToast({
- title: '暂无更多数据'
- })
- return
- } else {
- this.query.pageNum += 1;
- this.getlist()
- }
- },
- // 下拉刷新
- onPullDownRefresh() {
- setTimeout(() => {
- this.query.pageNum = 1;
- this.wb = [];
- this.getlist()
- }, 500)
- },
- onLoad(options) {
- this.query.createId = getApp().globalData.userId
- // this.query.createId = '1763382026214764546'
- this.getlist()
- },
- methods: {
- getlist() {
- myPayKnow(this.query).then(res => {
- this.wb = [...this.wb, ...res.rows]
- this.total = res.total
- uni.showToast({
- title: `加载成功`
- })
- })
- },
- goSanNong() {
- uni.navigateTo({
- url: '/pages/demo/sannong/sannong'
- });
- },
- goDetails(item) {
- if (item == null) return;
- getDetails(item.id).then(res => {
- let data = res.data
- data.urls = data.imgUrlList.split(',')
- uni.navigateTo({
- url: `/pages/common/articleDetail/articleDetail?data=${this.encodify(data)}`
- });
- })
- }
- }
- };
- </script>
- <style>
- @import 'myPayKnow.css';
- </style>
|