<template>
	<view class="content">
		<view class="list-scroll-content" v-for="(item, index) in bjsclist" :key="index" @click="navTo('/pages/share/wzDetail?id=' + item.id)">
			<view class="main">
				<view class="main-userInfo">
					<view class="avatar">
						<image :src="item.image_input[0]" mode=""></image>
					</view>
					<view class="main-user-info">
						<view class="main-userName">{{item.title}}</view>
						<view class="main-user-time">{{item.add_time}}</view>
					</view>
					<view class="fenxiang flex">
						<image class="img-lj" src="../../static/icon/lj.png"></image>
						<view class="wen-lj">{{item.visit}}</view>
					</view>
				</view>
				<view class="text">
					<view>{{ item.synopsis }}</view>
				</view>
				<view class="fh-im">
					<image v-for="img in item.image_input" class="fh-img" :src="img" mode=""></image>
				</view>
			</view>
		</view>
		<navigator url="/pages/user/release">
			<button class="butt">我要发布</button>
		</navigator>
		
		<u-tabbar activeColor="#01A6A8" inactive-color='#666666' :list="tabbar"></u-tabbar>
	</view>
	
</template>

<script>
	import {
		article
	} from '@/api/user.js';
	import {
		tabbar1
	} from '@/utils/tabbar.js';  //底部导航栏
	export default {
		data() {
			return {
				bjsclist:[],
				tabbar: tabbar1,
			};
		},
		onLoad() {
		},
		onShow() {
			this.loadData();
		},
		onReachBottom() {},
		
		methods: {
			navTo(url) {
				uni.navigateTo({
					url
				});
			},
			async loadData(source) {
				let obj = this;
					article({
								page: 1,
								limit: 1000
							},
							1
						)
						.then(({
							data
						}) => {
							this.bjsclist = data;
						})
						.catch(e => {
							console.log(e);
						});
			}
		}
	};
</script>

<style lang="scss">
	page,
	.content {
		min-height: 100%;
		height: auto;
		position: relative;
	}
	.butt {
		display: flex;
	    align-items: center;
		justify-content: center;
		height: 64rpx;
		position: fixed;
		bottom: 120rpx;
		right: 0rpx;
		color: #FFFFFF;
		font-size: 28rpx;
		background-color: #FF6F0F;
		border: none;
		border-radius: 40rpx 0% 0% 40rpx;
	}
	
	.main {
		margin: 20rpx;
		padding: 35rpx 20rpx 24rpx;
		background: #ffffff;
		width: 702rpx;
		border-radius: 30rpx;
		image {
			width: 100%;
			height: 100%;
		}

		.main-userInfo {
			display: flex;
			align-items: center;
			.avatar {
				width: 80rpx;
				height: 80rpx;
				background: #ffffff;
				border-radius: 50%;
			}
			.main-user-info {
				margin-left: 14rpx;
				line-height: 1;
				.main-userName {
					font-size: 28rpx;
					font-weight: bold;
					color: #000000;
				}

				.main-user-time {
					margin-top: 14rpx;
					font-size: 21rpx;
					font-weight: 500;
					color: #666666;
				}
			}
			.fenxiang {
				padding-left: 310rpx;
				.img-lj {
					width: 28rpx;
					height: 28rpx;
				}
				.wen-lj {
					font-size: 28rpx;
					color: #FF6F0F;
					padding-left: 10rpx;
				}
			}
		}
		.text {
			word-wrap: break-word;
			word-break: normal;
			margin: 20rpx 0rpx;
			font-size: 28rpx;
			font-weight: 500;
			color: #666666;
		}
		.fh-im {
			.fh-img {
				margin: 10rpx 21rpx 0rpx 0rpx ;
				width: 200rpx;
				height: 200rpx;
			}
		}
		
	}
</style>