<template>
	<view>
		<public-module></public-module>
		<view class="" style="position: fixed;width: 100%;">
			<u-tabs :list="list" :current="current" @change="change"></u-tabs>
		</view>
		<view class="" style="padding-top: 100rpx;box-sizing: border-box;">
			<view v-if="current==0" class="order">
				<view class="order1" v-for="(item,index) in list1" @click="admin(item.url)">
					<image :src="item.url" mode=""></image>
					<text>{{item.originalfilename}}</text>
				</view>
			</view>
			<view v-if="current==1" class="order">
				<view class="order1" v-for="(item,index) in list2" @click="admin(item.url)">
					<image :src="item.url" mode=""></image>
					<text>{{item.originalfilename}}</text>
				</view>
			</view>
			<view v-if="current==2" class="order">
				<view class="order1" v-for="(item,index) in list3" @click="admin(item.url)">
					<image :src="item.url" mode=""></image>
					<text>{{item.originalfilename}}</text>
				</view>
			</view>
			<view v-if="current==3" class="order">
				<view class="order1" v-for="(item,index) in list4" @click="admin(item.url)">
					<image :src="item.url" mode=""></image>
					<text>{{item.originalfilename}}</text>
				</view>
			</view>

			<view v-if="current==4" class="order">
				<view class="order1" v-for="(item,index) in list5" @click="admin(item.url)">
					<image :src="item.url" mode=""></image>
					<text>{{item.originalfilename}}</text>
				</view>
			</view>
			<view v-if="current==5" class="order">
				<view class="order1" v-for="(item,index) in list6" @click="admin(item.url)">
					<image :src="item.url" mode=""></image>
					<text>{{item.originalfilename}}</text>
				</view>
			</view>
			<view v-if="current==6" class="order">
				<view class="order1" v-for="(item,index) in list7" @click="admin(item.url)">
					<image :src="item.url" mode=""></image>
					<text>{{item.originalfilename}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					name: '推荐'
				}, {
					name: '保险'
				}, {
					name: '车险',
				}, {
					name: '增员'
				}, {
					name: '产品'
				}, {
					name: '保险段子',
				}, {
					name: '节日',
				}],
				current: 0,
				dirId1: "P0001",
				dirId2: "P0002",
				dirId3: "P0003",
				dirId4: "P0004",
				dirId5: "P0005",
				dirId6: "P0006",
				dirId7: "P0007",
				list1: [],
				list2: [],
				list3: [],
				list4: [],
				list5: [],
				list6: [],
				list7: [],
			}
		},
		async onLoad() {
			let res1 = await this.$http.get('/insFile/queryList?dirId=' + this.dirId1);
			this.list1 = res1.data;
			let res2 = await this.$http.get('/insFile/queryList?dirId=' + this.dirId2);
			this.list2 = res2.data;
			let res3 = await this.$http.get('/insFile/queryList?dirId=' + this.dirId3);
			this.list3 = res3.data;
			let res4 = await this.$http.get('/insFile/queryList?dirId=' + this.dirId4);
			this.list4 = res4.data;
			let res5 = await this.$http.get('/insFile/queryList?dirId=' + this.dirId5);
			this.list5 = res5.data;
			let res6 = await this.$http.get('/insFile/queryList?dirId=' + this.dirId6);
			this.list6 = res6.data;
			let res7 = await this.$http.get('/insFile/queryList?dirId=' + this.dirId7);
			this.list7 = res7.data;

		},
		methods: {
			change(index) {
				this.current = index;
			},
			admin(data) {
				uni.navigateTo({
					url: "/pages/tools/poster/poster-detail?img=" + data
				})
			}
		}
	}
</script>
<style>
	.tabs {
		border-bottom: 2rpx solid #F0EFF4;
		position: fixed;
		z-index: 999;
	}

	.order {
		width: 100%;
		height: auto;
		padding: 26rpx;
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
		flex-wrap: wrap;
	}


	.order1 {
		width: 48%;
		text-align: center;
		margin-bottom: 20px;
	}

	.order1>text {
		font-weight: bold;
	}

	image {
		width: 100%;
		height: 600rpx;
		border-radius: 20rpx;
	}
</style>
