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

		<view class="con">
			<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>
		<u-loadmore 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
				uni.navigateTo({
					url: '/pages/index/mainDetail/index'
				})
			}
		}
	}
</script>

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