<template>
	<div class="app-list-content">
		<cl-crud class="liu-crud-wrap" @load="onLoad"> </cl-crud>
	</div>
</template>

<script>
export default {
	data() {
		return {
			// cl-crud
			app: null
		};
	},
	mounted() {},
	methods: {
		// crud
		onLoad({ ctx, app }) {
			this.app = app;
			let applyHost = () => {
				return this.$service.sassShop.buyList();
			};
			ctx.service({
				page: applyHost
			})
				.set('table', {
					columns: [
						{
							prop: 'id',
							label: 'ID',
							align: 'center'
						},
						{
							prop: 'merchantName',
							label: '花店名称',
							align: 'center'
						},
						{
							prop: 'userName',
							label: '店长',
							align: 'center'
						},
						{
							prop: 'mobile',
							label: '手机号',
							align: 'center'
						},
						{
							prop: 'prePrice',
							label: '付款金额',
							align: 'center',
							emptyText: '无'
						},
						{
							prop: 'createTime',
							label: '付款时间',
							align: 'center',
							emptyText: '无'
						},
						{
							prop: 'updateTime',
							label: '到期时间',
							align: 'center',
							emptyText: '无'
						},
						{
							prop: 'setName',
							label: '套餐',
							align: 'center',
							emptyText: '无'
						}
					],
					// 操作列
					op: {
						visible: false, // 是否显示
						// 同 element-ui Table-column Attributes
						props: {
							width: 150,
							align: 'center',
							fixed: 'right',
							label: '操作'
						},
						// 布局，请移步 `layout`
						layout: []
					}
				})
				.set('layout', [
					['slot-tabs'],
					['flex1', 'refresh-btn'],
					['data-table'],
					['flex1', 'pagination']
				])
				.done();
			app.refresh();
		}
	}
};
</script>
