<template>
	<view>
		<view class="boxWarp mb20px">
			<view class="box linear2" style="height:100vh;">
				<view class="boxContent2" style="margin-top:50%;">
					<view class="clearfix" style="margin-bottom: 10px;">
						<text class="fz26px" style="font-weight: bold;">{{dinList.name ? dinList.name : '无'}}</text>
						<u-line dashed></u-line>
					</view>
					<view class="flex-container">
						<text class="flex-item">营业状态</text>
						<u-tag class="flex-item tag-item" plain :text="dinList.openState ? '营业中' : '离线'" :type="dinList.openState ? 'success' : 'error'" size="mini"></u-tag>
					</view>
					<text>客服电话：18011111111</text>
				</view>
				<view class="footer">
					<u-button type="primary" shape="circle" icon="phone" text="拨打客服电话"
						color="linear-gradient(to right, #F54319, #FF6D20)" @click="call()"></u-button>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				img: 'https://cdn.uviewui.com/uview/album/1.jpg',
				orderinfo: {},
				dinList: {
					name: '23333',
					openState: 1,
				},
			}
		},
		onLoad(e) {
		  this.fatchDate(e);
		},
		// created() {
		// 	this.fatchDate(e.id)
		// },
		methods: {
			call() {
				if (this.orderinfo.shopCall) {
					uni.makePhoneCall({
						phoneNumber: this.orderinfo.shopCall
					});
				} else {
					uni.showToast({
						icon: 'none',
						title: '暂无商家电话'
					})
				}
			},
			fatchDate(e) {
				console.log('e===========================e', e)
				var queryParmas = {
					id : e.id
				}
				console.log('idididididid', queryParmas)
				const result = this.$request('post', '/sale/diningCar/queryDiningCarById', queryParmas)
				if (result) {
					this.dinList = result.data
				}
			}

		}
	}
</script>

<style lang="scss" scoped>
	.font {
		font-family: "CustomFont";
		color: #fff;
	}

	.flex-container {
		display: flex;
		align-items: center;
		/* 垂直居中 */
		justify-content: flex-start;
		/* 水平左对齐 */
	}

	.flex-item {
		/* 根据需要设置text的宽度 */
		width: 100%;
		/* 或者其他适当的宽度 */
	}

	.tag-item {
		margin-left: auto;
		/* 将标签推到右边 */
	}

	.box {
		padding: 20rpx 0;
		// background-image: linear-gradient(#00a551 10%, #fff 30%);
		border-bottom-left-radius: 30rpx;
		border-bottom-right-radius: 30rpx;
		background-position: top;
		box-shadow: 0 0 5px 2px #ebebeb;
		background-repeat: no-repeat;
	}

	.linear2 {
		// background-image: linear-gradient(#00a551 20%, #fff 50%);
		background-image: url('https://cdn.uviewui.com/uview/album/1.jpg');
	}

	.boxText {
		font-size: 28rpx;
		line-height: 40rpx;
		color: #c8c9cc;
	}

	.tabFlexBox {
		display: flex;
		text-align: center;
		// background-color: #fff;
		padding-bottom: 10rpx;
	}

	.tabFlexBox .tabFlexBoxItem {
		flex: 1;
		position: relative;
	}

	.tabFlexBox .tabFlexBoxItem .tabFlexBoxItemTitle {
		font-size: 36rpx;
		font-weight: bold;
		line-height: 80rpx;
	}

	.tabFlexBox .tabFlexBoxItem .tabFlexBoxItemDes {
		color: #c8c9cc;
		font-size: 28rpx;
		line-height: 40rpx;
		display: inline-block;
		padding: 0 20rpx;
	}

	.tabFlexBox .tabFlexBoxItem .tabFlexBoxItemLine {
		width: 1px;
		height: 50rpx;
		background-color: #c8c9cc;
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		right: 0;
	}

	.tabFlexBox .tabFlexBoxItem.active .tabFlexBoxItemTitle {
		color: #00a551;
		font-size: 40rpx;
	}

	.tabFlexBox .tabFlexBoxItem.active .tabFlexBoxItemDes {
		background-color: #00a551;
		border-radius: 20rpx;
		color: #fff;
	}

	.boxContent2 {
		border-radius: 60rpx;
		background-color: #fff;
		padding: 40rpx;
	}

	.carList {
		display: flex;
		// flex-wrap: wrap;
	}

	.footer {
		flex-direction: column;
		position: fixed;
		left: 5px;
		right: 5px;
		bottom: 10px;
	}
</style>