<template>
	<view class="box">
		<view class="boxlist"> 
			<view @click="nextTo(item)" class="bb vidLi dfsb" v-for="(item, ind) in list" :key="ind">
				<image class="imgbox" :src="item.img" mode=""></image>
				<view class="dffd flex1">
					<view class="title elli">{{ item.title||item.name }}</view>
					<view class="textgrey fontsm">{{ item.up_name }}</view>
					<view v-if="flag == 2" class="auth dfsb">
						<!-- 分类中的文档类 flag=2 -->
						<text class="fontssm textgrey">作者：{{ item.athour }}</text>
						<text class="fontssm textgrey">{{ item.down_num || 0 }}人下载</text>
					</view>
				</view>
				<image v-if="flag == 3" class="down" src="/static/img/pro/navdown.png" mode=""></image>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {};
	},
	props: {
		list: {
			type: Array,
			default: []
		},
		flag: {
			type: [String, Number],
			default: 1
		}
	},
	methods: {
		nextTo(item) {
			// if (this.flag == 1) {
			// 	uni.navigateTo({
			// 		url: '/pages/index/navInfo?id=' + item.id
			// 	});
			// } else {
			// 	uni.navigateTo({
			// 		url: '/pages/index/navDet?id=' + item.id
			// 	});
			// } 
				uni.navigateTo({
					url: '/pages/index/navDet?id=' + item.id
				});
		}
	}
};
</script>

<style scoped lang="scss">
.boxlist {
	.vidLi {
		width: 100%;
		padding: 27rpx 0;
		background-color: #fff;
		&:nth-of-type(2n) {
			margin-right: 0;
		}
		.imgbox {
			width: 146rpx;
			height: 146rpx;
			margin-right: 18rpx;
		}
		.title {
			font-size: 28rpx;
			line-height: 40rpx;
			margin-bottom: 12rpx;
		}
		.auth {
			margin-top: 15rpx;
			width: 100%;
		}
		.down {
			width: 35rpx;
			height: 30rpx;
			margin-left: 58rpx;
		}
	}
}
</style>
