<template>
	<view class="container">
		<view class="list">
			<navigator :url="`/saomaDiancan/printerLabeldetail/printerLabeldetail?id=${item.id}&tag_name=${item.tag_name}&num=${item.num}&type=${type}`" class="item"  v-for="(item,index) in list" :key="index">
				<view class="name">{{item.tag_name}}</view>
				<view class="content">
					
					<view class="flex flex-y-center">
						<view class="cell flex flex-y-center">
							<view class="title">门店：</view>
							<view class="desc">{{item.store_title}}</view>
						</view>
					</view>	
					
					<view class="flex flex-y-center" style="margin-top: 16rpx;">
						<view class="cell flex flex-y-center">
							<view class="title">排序：</view>
							<view class="desc">{{item.num}}</view>
						</view>
					</view>	
					<view class="flex flex-y-center" style="margin-top: 16rpx;">
						<view class="cell flex flex-y-center arr-r" style="width:100%">
							<view class="title">创建时间：</view>
							<view class="desc">{{item.create_time}}</view>
						</view>
					</view>
				</view>
			</navigator>
			<view class="no-more">没有更多内容了~</view>
		</view>

		<view class="footer-bar">
			<view class="content flex flex-center">
				<navigator :url="`/saomaDiancan/editprinerlabel/editprinerlabel?type=${type}`" class="btn">+新增标签</navigator>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				store_id:"",admin_id:'',
				list: [],
				page: 1,
				is_bottom: false,
				type:2,
			}
		},

		onLoad(options) {
			this.type=options.type;
			this.store_id =  uni.getStorageSync("store_id");
			this.admin_id= uni.getStorageSync("admin_id");
		},
		
		onShow() {
			this.getData()
		},
		
		onReachBottom() {
			// if (!this.is_bottom) {
			// 	this.getData(this.page + 1)
			// }
		},
		
		methods: {
			getData(page) {
				// if (page == 1) {
				// 	this.list = []
				// 	this.page = 1
				// 	this.is_bottom = false
				// }
				this.request({
					url: 'Smdcshop/print_tag',
					data: {
						store_id: this.store_id,
						admin_id:this.admin_id,
					}
				}).then(res => {
					if (res.code =="200") {
						this.list =res.data
						 // this.list.concat(res.data)
						// this.page = page
						// 
					} else {
						this.is_bottom = true
					}
				})
			}
		}
	}
</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: 50%;
		box-sizing: border-box;
		padding-right: 30rpx;
		font-size: 26rpx;
		line-height: 37rpx;
		color: #666;
	}

	.list .item .content .cell .title {
		color: #99A0AD;
	}

	
</style>
