<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'

	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;
				uni.navigateTo({
          url: '/pages/highServer/knowledgeDetails/knowledgeDetails?id=' + item.id,
				});
			}
		}
	};
</script>
<style>
	@import 'myPayKnow.css';
</style>
