<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)">
				<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>
	import {
		getMallReq,
	} from '@/api/test/index.js'
	export default {
		components: {

		},
		data() {
			return {
				picUrl: this.$picUrl,
				picBase: this.$picBase,
				list: [],
				name: ''
			}
		},
		async onLoad(o) {
			console.log('typeNameId ', o.typeNameId);
			this.name = o.name
			let res = await getMallReq({
				typeNameId: o.typeNameId,
				// typeNameId: 11,
				brand: o.brand,
				type: o.type,
			})
			if (res.code == 0) {
				this.list = res.data
				console.log('获取商城列表数据返回值-子分类: ', res);
			}
		},
		methods: {
			goDetail(item) {
				getApp().mallItem = item
				uni.navigateTo({
					url: '/pages/mall/detail/index'
				})
			}
		}
	}
</script>

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