<template>
	<view class="container">
		<view class="list">

			<view @click="nav(index,item.id)" class="item" v-for="(item,index) in list" :key="index">
				<view class="name">{{item.name}}</view>
				<view class="content flex flex-y-center">
					<view class="cell flex flex-y-center arr-r">
						<view class="title">添加时间：</view>
						<view class="desc text-1">{{item.create_time}}</view>
					</view>
				</view>
			</view>

			<view class="no-more">没有更多内容了~</view>
		</view>

		<view class="footer-bar">
			<view class="content flex flex-center">
				<navigator url="./editGoodsCat" class="btn">+新增分类</navigator>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
			}
		},
		onLoad(e) {

		},

		onShow() {
			this.cygoods_category_index();
		},

		methods: {
			
			nav(index,id) {
				let obj = this.list[index];
				uni.setStorageSync("category_info", obj);
				uni.navigateTo({
					url: `./goodsCatDetail?id=${id}`
				})
			},
			
			cygoods_category_index(e) {
				this.request({
					url: "Smdcshop/jftype_index",
					data: {
						admin_id: uni.getStorageSync("admin_id")
					},
				}).then(res => {
					console.log(res, "res")
					if (res.code === '200') {
						this.list = res.data;
					}
				});
			},
		},
	}
</script>

<style>
	@import url("../static/css/common.css");

	page {
		background-color: #F4F5F7;
	}

	.list {
		padding: 30rpx 25rpx;
	}

	.list .item {
		border-radius: 8rpx;
		overflow: hidden;
		padding-left: 30rpx;
		border-left: 8rpx solid #247EFF;
		background-color: #fff;
		margin-bottom: 30rpx;
	}

	.list .item .name {
		height: 80rpx;
		border-bottom: 1rpx solid #f5f5f5;
		font-size: 30rpx;
		line-height: 80rpx;
		font-weight: bold;
	}

	.list .item .content {
		padding: 20rpx 0 24rpx;
	}

	.list .item .content .cell {
		flex: none;
		width: 100%;
		box-sizing: border-box;
		padding-right: 30rpx;
		font-size: 26rpx;
		line-height: 37rpx;
		color: #666;
	}

	.list .item .content .cell .title {
		color: #99A0AD;
		flex: none;
	}
</style>
