<template>
	<home-frame @toPath="toPath">
		<view class="main">
			<view class="one">
				<view class="list" v-for="(item,index) in list" :key="index">
					<image class="image" :src="item.img_url&&item.img_url.length>0?item.img_url[0].url:''" mode="">
					</image>
					<view class="name textOver">
						{{item.name}}
					</view>
				</view>
			</view>
		</view>
	</home-frame>
</template>

<script>
	import homeFrame from "../components/home-frame.vue";
	export default {
		components: {
			homeFrame
		},
		data() {
			return {
				list: [ //
					{
						name: '热门应用',
						img_url: [ //
							{
								id: "20230216100918",
								name: "头像.jpg",
								status: "success",
								uid: 1676513358695,
								uri: "/files/projectadmin/imgurl/20230216100918.jpg",
								url: "http://47.93.34.200/files/projectadmin/imgurl/20230216100918.jpg"
							}
						]
					}
				]
			};
		},
		onLoad() {

		},
		onShow() {

		},
		methods: {
			// 跳转页面
			toPath(e) {
				let url = `/${e.route}`;
				if (e.type == '0') uni.navigateTo({
					url
				})
				else if (e.type == '1') uni.redirectTo({
					url
				})
				else if (e.type == '2') uni.reLaunch({
					url
				})
				else if (e.type == '3') uni.switchTab({
					url
				})
			}
		},
	};
</script>

<style lang="scss">
	.main {
		background-color: var(--rgb000);
		display: flex;
		flex-direction: column;
		width: 100vw;
		height: 92vh;

		.one {
			padding: 8px;
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;
			background-color: var(--rgb000);

			.list {
				width: 18%;
				margin: 0 0 10px 0;

				.image {
					width: 100%;
					height: 62px;
					overflow: hidden;
					border-radius: 5px;
				}

				.name {
					font-size: 12px;
					color: var(--rgbfff);
					text-align: center;
				}
			}
		}
	}
</style>
