<template>
	<view class="content">
		<view :style="{ height: `calc(${globalData.statusBarHeight}rpx + 130rpx)` }"></view>

		<view v-if="articleList.length" class="friends-list-box">
			<evaluateList :list="articleList" @getId="handleDetail"></evaluateList>
		</view>
		<view v-else class="diagram">
			<image src="@/static/icon/qst.png" mode=""></image>
			<view class="">
				暂无数据
			</view>
		</view>
		<com-navbar :leftIcon="false" :homeShow="false" bgColor="#fff" title="动态"
			:titleStyle="{ color: '#000', fontSize: '32rpx',scrollTopHeader: scrollTopHeader }" />
		<com-tabbar :list=" [{
					name: '首页',
					icon: '/static/tabbar/tb1.png', 
					selectIcon:'/static/tabbar/td1.png', 
					url: '/pages/home/index',
					type: 'type'
				}, {
					name: '我的需求', 
					icon: '/static/tabbar/tb2.png',
					selectIcon: '/static/tabbar/td2.png', 
					url: '/pages/demand/index',
					type: 'type'
				}, {
					name: '发布', 
					icon: '/static/tabbar/fb.png',
					selectIcon:'/static/tabbar/fb.png', 
					url: '/pages/release/index', 
					type: 'type'
				}, {
					name: '动态',
					icon: '/static/tabbar/tb3.png', 
					selectIcon: '/static/tabbar/td3.png', 
					url: '/pages/order/index',
					type: 'order'
				}, {
					name:'我的' ,
					icon:'/static/tabbar/tb4.png' ,
					selectIcon:'/static/tabbar/td4.png', 
					url: '/pages/my/index',
					type: 'type'
				}]"></com-tabbar>
	</view>
</template>

<script>
	import {userArticleGet} from '../../api/order/index.js'
	import evaluateList from '../../components/evaluate.vue'
	export default {
		components: {
			evaluateList,
		},
		data() {
			return {
				globalData: getApp().globalData,
				queryParams:{
					pageNum:1,//当前页数
					pageSize:10,//分页大小
				},
				articleList:[],//文章列表
				total:0,//总数
				
				evaluateList: [{
					name: '马保国',
					image: 'https://slzh-oss.oss-cn-beijing.aliyuncs.com/usercenter/template/2c94809a787cec070179e01ec0ba02a9.jpg',
					time: '2021.06.06',
					content: '服务好，景色好，山河锦绣，树木茂盛，空气清新，鸟语花香，人杰地灵服务好，景色好，山河锦绣，树木茂盛，空气清新，鸟语花香，人杰地灵服务好，景色好，山河锦绣，树木茂盛，空气清新，鸟语花香，人杰地灵服务好，景色好，山河锦绣，树木茂盛，空气清新，鸟语花香，人杰地灵服务好，景色好，山河锦绣，树木茂盛，空气清新，鸟语花香，人杰地灵',
					imageList: [{
							url: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
						},
						{
							url: 'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
						},
						{
							url: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
						},
						{
							url: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
						},
						{
							url: 'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
						},
						{
							url: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500'
						},
						
					]
				}],
				personEvalList: [{
						avatar: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
						nickname: '李哈哈',
						date: '2022-01-31',
						content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
					},
					{
						avatar: 'https://img1.baidu.com/it/u=3486651663,3991438881&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
						nickname: '李小乖',
						date: '2022-05-11',
						content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
					},
					{
						avatar: 'https://img2.baidu.com/it/u=955956276,3392954639&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
						nickname: '李哈哈',
						date: '2022-01-31',
						content: '评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容评论内容'
					},
				]
			}
		},
		onReachBottom() {
			let that = this
			if(that.total <= that.queryParams.pageNum * that.queryParams.pageSize) return
			that.queryParams.pageNum++
			that.getArticleList()
		},
		onShow() {
			this.getArticleList()
		},
		methods: {
			async getArticleList(){
				let that = this
				const data_back = await userArticleGet(that.queryParams);
				const {code,total,rows} = data_back;
				if(code === 200 && total > 0) {
					that.articleList = rows
					that.total = total
				}
			},
			
			
			handleDetail(id) {
				let that = this
				that.$uniGo.navigateTo({
					url: `/order/detail/detail?id=${id}`
				})

			}
		}
	}
</script>

<style lang="scss" scoped>
	.friends-list-box {
		/* background-color: #FFFFFF;
		padding: 30rpx 20rpx;
		border-radius: 10rpx;
		margin: 10px 20rpx 0 20rpx;
		box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1); */
	}
	.diagram {
		text-align: center;
		margin-top: 335rpx;
	
		>image {
			width: 396rpx;
			height: 243rpx;
		}
	
		>view {
			margin-top: 20rpx;
			font-size: 24rpx;
			font-weight: 400;
			color: #444444;
		}
	}
</style>
