<template>
	<view>
		<view class="table">
			<uni-table border stripe emptyText="暂无更多数据">
				<!-- 表头行 -->
				<uni-tr>
					<uni-th align="left">时间</uni-th>
					<uni-th align="left">人数</uni-th>
				</uni-tr>
				<!-- 表格数据行 -->
				<uni-tr v-for="(item,index) in list" :key="index">
					<uni-td>{{item.time}}</uni-td>
					<uni-td>{{item.nums}}</uni-td>
				</uni-tr>
			</uni-table>
		</view>
	</view>
</template>

<script>
	import {
		dateFormat
	} from '../../../utils/date'
	export default {
		data() {
			return {
				list: [],
			}
		},
		mounted() {
			const {
				extJson
			} = this.options
			if (extJson) {
				this.list = JSON.parse(extJson).map(e => {
					e.time = dateFormat(new Date(e.time))
					return e
				})
			}
		},
		methods: {}
	}
</script>

<style scoped lang="scss">
	.table {
		padding: 30rpx;

		tr:nth-child(2n+1) {
			background-color: #F2F8FF !important;
		}

		tr:first-child {
			background-color: #F5F5F5 !important;
		}

		th {
			color: #777777;
			font-size: 28rpx;
		}

		td {
			color: #333333;
			font-size: 28rpx;
		}
	}
</style>