<template>
	<view class="default-box-padding bg-fff border-r-12 u-m-t-24">
		<view class="u-flex u-row-between">
			<view>订单状态</view>
			<view>{{returnStatus(data.status)}}</view>
		</view>
		<view class="u-flex u-row-between u-m-t-24">
			<view>订单类型</view>
			<view>{{returnUseType(data.useType)}}</view>
		</view>
		<view class="u-flex u-row-between u-m-t-24">
			<view>桌位号</view>
			<view>{{table.name||data.tableName}}</view>
		</view>
		<view class="u-flex u-row-between u-m-t-24" v-if="seatFee.number">
			<view>就餐人数</view>
			<view>{{seatFee.number||''}}</view>
		</view>
		<view class="u-flex u-row-between u-m-t-24">
			<view>支付方式</view>
			<view>{{data.payType||''}}</view>
		</view>
		<!-- <view class="u-flex u-row-between u-m-t-24">
			<view>预约时间</view>
			<view></view>
		</view> -->
		<view class="u-flex u-row-between u-m-t-24">
			<view>下单时间</view>
			<view><up-text v-if="data.createdAt" mode="date" format="yyyy-mm-dd hh:MM:ss"
					:text="data.createdAt"></up-text></view>
		</view>
		<view class="u-flex u-row-between u-m-t-24">
			<view>订单编号</view>
			<view class="u-flex">
				<view>{{data.orderNo}}</view>
				<view v-if="data.orderNo" class="u-m-l-6">
					<up-copy :content="data.orderNo" >
						<up-icon name="/static/copy.svg" :size="16"></up-icon>
					</up-copy>
				</view>
				
			</view>
		
		</view>
		<view class="u-flex u-row-between u-m-t-24 u-col-top">
			<view class="no-wrap">商家备注</view>
			<view class="u-p-l-32 " style="max-width: 522rpx;    word-wrap: break-word;">
				{{data.remark}}
			</view>
			<!-- <my-button plain shape="circle" :width="160" :height="60">编辑</my-button> -->
		</view>
	</view>
</template>

<script setup>
	import orderEnum from '@/commons/orderEnum.js'
	const props = defineProps({
		data: {
			type: Object,
			default: () => {}
		},
		table: {
			type: Object,
			default: () => {}
		},
		seatFee: {
			type: Object,
			default: () => {
				totalNumber: 0
			}
		}
	})

	function returnStatus(status) {
		const item = orderEnum.status.find(v => v.key == status)
		return item ? item.label : ''
	}

	function returnUseType(useType) {
		if (!useType) {
			return ''
		}
		return useType == "takeout" ? '自取' : '堂食';
	}
</script>

<style lang="scss" scoped>
</style>