<template>
	<view class="page">
		<navBar :title="name" :back="true" color="black" background="white" />

		<view class="con" v-if="list.length!=0">
			<view class="item" v-for="(item,index) in list" @click="goDetail(item,index)">
				<view class="topBox">
					<image :src="picBase+item.cover" mode=""></image>
				</view>
				<view class="bottom">
					<view class="txt">
						{{item.name}}
					</view>
				</view>
			</view>
		</view>
		<view class="con" v-else style="justify-content: center;">
			<u-empty mode="data" text="暂无数据" width="160" height="160" :icon="picUrl+'/static/other/empty.png'">
			</u-empty>
		</view>
		<u-loadmore v-if="list.length!=0" style="" loadmoreText="已经到底啦" color="#CCCCCC" lineColor="#CCCCCC" line />
	</view>
</template>

<script>
	export default {
		components: {

		},
		data() {
			return {
				picUrl: this.$picUrl,
				picBase: this.$picBase,

				list: [],
				name: '',
			}
		},
		onLoad(o) {
			this.name = o.name

			this.list = getApp().typeList

			console.log('传过来的列表', this.list);
		},
		methods: {
			goDetail(item, index) {
				getApp().ktItem = item
				getApp().ktIndex = index
				getApp().ktName = this.name

				// getApp().mianFromType = 'list'
				uni.navigateTo({
					url: '/pages/index/mainDetail/index?mianFromType=2'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import "./index.scss";
</style>