<template>
	<view class="container">
		<view class="address">
			<view class="name">体育中心餐厅</view>
			<view>
				<u-icon name="map" size="40" color="#d90209"></u-icon>
			</view>
			<view class="address-info">三香路1511号</view>
		</view>
		<view class="tips">注:约5分钟后取餐，请尽快到餐厅取餐哦</view>
		<view class="order-detail box-shadow">
			<view class="name">餐品详情</view>
			<view class="list">
				<view class="order-single">
					<image src="../../static/img.jpg"></image>
					<view class="title-wrap">
						<view class="title">两份香辣鸡翅(共4块)</view>
						<view class="num">x3</view>
					</view>
					<view class="price">
						<view>
							<text>￥</text>
							11.9
						</view>
						<view class="original">￥25</view>
					</view>
				</view>
				<view class="order-single">
					<image src="../../static/img.jpg"></image>
					<view class="title-wrap">
						<view class="title">两份香辣鸡翅(共4块)</view>
						<view class="num">x3</view>
					</view>
					<view class="price">
						<view>
							<text>￥</text>
							11.9
						</view>
						<view class="original">￥25</view>
					</view>
				</view>
			</view>
			<view class="coupon-line">
				<view class="title">
					<image src="../../static/order1.png"></image>
					<text>优惠券</text>
				</view>
				<view class="value">
					<text>暂无优惠券</text>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view class="coupon-line">
				<view class="title">
					<image src="../../static/order1.png"></image>
					<text>代金券</text>
				</view>
				<view class="value">
					<text>暂无代金券</text>
					<u-icon name="arrow-right"></u-icon>
				</view>
			</view>
			<view class="sum">
				<view>共3件</view>
				<view>小计：</view>
				<view class="num">
					<text>￥</text>
					33.7
				</view>
			</view>
		</view>
		<view class="user-mobile-line box-shadow">
			<view>
				<view>联系号码</view>
				<view class="tips">仅用于接收取餐码，请正确填写</view>
			</view>
			<view class="mobile">18914071203</view>
		</view>
		<view class="meal-type box-shadow">
			<view class="title">就餐方式</view>
			<view class="block">
				<view class="btn" :class="{'select':inline}" @click="inline=true,outside = false">
					<image src="../../static/order2.png"></image>
					<text>店内就餐</text>
				</view>
				<view class="btn" :class="{'select':outside}" @click="inline=false,outside = true">
					<image src="../../static/order3.png"></image>
					<text>打包带走</text>
				</view>
			</view>
		</view>
		<view class="user-remark box-shadow">
			<view class="title">备注</view>
			<view class="value" @click="showRemark=true">
				<text>口味、偏好等要求</text>
				<u-icon name="arrow-right"></u-icon>
			</view>
		</view>

		<view class="user-remark-dialog">
			<u-popup v-model="showRemark" mode="bottom" width="90%" :border-radius="32">
				<view class="title">
					<view>备注</view>
					<u-icon @click="showRemark = false" name="close-circle" color="rgba(0, 0, 0, .5)"
						size="40"></u-icon>
				</view>
				<view class="content">
					<view>
						<u-input :custom-style="{'background':'rgba(0, 0, 0, .05)','padding':'10rpx'}" v-model="remark"
							type="textarea" height="100" :border="false" />
					</view>
					<view class="tag">快捷标签</view>
					<view class="tag-list">
						<text>去冰</text>
						<text>少冰</text>
						<text>老北京不加酱</text>
					</view>
				</view>
				<view class="btn">
					<view>保存</view>
				</view>
			</u-popup>
		</view>

		<view class="cart-box">
			<view>
				<view>
					<image src="../../static/cart.png"></image>
					<view>￥33.97</view>
					<view class="discount">已省¥41.3元 </view>
				</view>
				<view class="order-check" @click="confirmOrder = true">
					<view>提交订单</view>
					<view class="checkout">Checkout</view>
				</view>
			</view>

		</view>

		<view class="confirm">
			<u-popup v-model="confirmOrder" mode="center" width="85%" :border-radius="40">
				<image class="confirm-bg" mode="widthFix" src="../../static/confirm-order-bg.png"></image>
				<view class="confirm-content">
					<view class="confirm-title">
						<view>请核对地址</view>
						<view class="circle">
							<u-icon name="map" color="#d90209" size="40"></u-icon>
						</view>
					</view>
					<view class="confirm-address">
						<view class="name">体育中心餐厅</view>
						<view class="address-info">三香路1511号</view>
					</view>
					<view class="confirm-tips">
						提示：请确认取餐地址是否正确，稍后可在【我的订单】查看订单状态，请耐心等待。
					</view>
					<view class="confirm-btn">
						<view @click="confirmOrder=false">再想一想</view>
						<view @click="goPay">立即支付</view>
					</view>
				</view>

			</u-popup>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				showRemark: false,
				remark: '',
				inline: true,
				outside: false,
				confirmOrder: false
			}
		},
		methods: {
			goPay() {
				uni.navigateTo({
					url:'/pages/order/pay'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.container {
		width: 100vw;
		height: 100vh;
		background: #f0f0f0;
		overflow: scroll;
		font-family: Avenir, Helvetica, Arial, sans-serif;
		padding-bottom: 200rpx;

		.address {
			width: 100%;
			background: #fff;
			border-radius: 0 0 40rpx 40rpx;
			font-size: 26rpx;
			color: rgba(0, 0, 0, .5);
			padding: 20rpx;

			&>view {
				text-align: center;
				margin-bottom: 10rpx;
			}

			.name {
				font-size: 40rpx;
				color: rgba(0, 0, 0, .9);
				font-weight: 600;
			}
		}

		.tips {
			color: #d90209;
			font-size: 26rpx;
			padding: 30rpx 0;
			padding-bottom: 0;
			text-align: center;
		}

		.box-shadow {
			box-shadow: 1rpx 1rpx 5rpx 0 rgba(0, 0, 0, .1);
			background-color: #fff;
			border-radius: 20rpx;
			margin: 20rpx;
		}

		.order-detail {
			.name {
				font-weight: 600;
				color: rgba(0, 0, 0, .9);
				font-size: 30rpx;
				padding: 20rpx;
				padding-left: 40rpx;
				border-bottom: 1rpx solid rgba(0, 0, 0, .15);
			}
		}

		.list {
			border-bottom: 1rpx solid rgba(0, 0, 0, .15);

			.order-single {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 30rpx;
			}

			image {
				width: 112rpx;
				height: 82rpx;
			}

			.title-wrap {
				display: flex;
				align-items: center;
				justify-content: space-between;
				width: 60%;
			}

			.title {
				color: #000;
				font-size: 24rpx;
				font-weight: 600;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 2;
				width: 60%;
			}

			.num {
				color: rgba(0, 0, 0, .5);
				font-size: 26rpx;
				width: 40%;
				text-align: right;
			}

			.price {
				font-size: 30rpx;
				font-weight: 600;

				text {
					font-size: 24rpx;
					margin-right: 5rpx;
				}
			}

			.original {
				text-align: right;
				color: rgba(0, 0, 0, .3);
				text-decoration: line-through;
				font-size: 22rpx;
			}
		}

		.coupon-line {
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 30rpx;
			font-size: 30rpx;
			font-weight: 600;
			border-bottom: 1rpx solid rgba(0, 0, 0, .15);

			.title {
				display: flex;
				align-items: center;

				image {
					width: 44rpx;
					height: 44rpx;
					margin-right: 10rpx;
				}
			}

			.value {
				font-size: 26rpx;
				color: #999;
				background: #f4f4f4;
				padding: 5rpx 20rpx;
				padding-right: 10rpx;
				border-radius: 30rpx;
				font-weight: normal;
			}
		}

		.sum {
			font-size: 26rpx;
			font-weight: 600;
			display: flex;
			justify-content: end;
			align-items: center;
			padding: 30rpx;

			&>view {
				margin-left: 20rpx;
			}

			.num {
				margin-left: 0rpx;
				font-size: 36rpx;
				color: #d90209;

				text {
					font-size: 20rpx;
				}
			}
		}

		.user-mobile-line {
			color: rgba(0, 0, 0, .9);
			font-weight: 600;
			font-size: 30rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 30rpx;

			.tips {
				font-weight: 400;
				white-space: nowrap;
				color: rgba(0, 0, 0, .6);
				font-size: 20rpx;
				padding: 0;
			}

			.mobile {
				font-size: 26rpx;
			}
		}

		.meal-type {
			.title {
				color: rgba(0, 0, 0, .9);
				font-weight: 600;
				font-size: 30rpx;
				padding: 30rpx;
			}

			.block {
				display: flex;
				justify-content: space-between;
				align-items: center;
				padding: 30rpx;
				padding-top: 0;
				padding-bottom: 60rpx;
			}

			.btn {
				width: 48%;
				box-sizing: border-box;
				border: 1rpx solid #313131;
				border-radius: 10rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				padding: 10rpx;
				font-size: 26rpx;
				color: rgba(0, 0, 0, .5);

				image {
					width: 44rpx;
					height: 44rpx;
					margin-right: 20rpx;
				}
			}

			.select {
				border: 1rpx solid #d90209;
				background: #fdf0f0;
				color: #d90209;
				background: url(../../static/order-bg.png) no-repeat right bottom;
				background-size: 40rpx 26rpx;
			}
		}

		.user-remark {
			padding: 30rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			padding: 30rpx;
			font-size: 30rpx;
			font-weight: 600;

			.title {}

			.value {
				color: rgba(0, 0, 0, .9);
				font-size: 24rpx;
				font-weight: normal;
			}
		}

		.cart-box {
			position: fixed;
			left: 0;
			bottom: 64rpx;
			padding: 20rpx;
			width: 100%;

			&>view {
				padding: 5rpx 10rpx;
				border-radius: 60rpx;
				padding-right: 20rpx;
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;
				background-color: #d90209;
				color: #fff;
				font-size: 44rpx;
				width: 100%;

				image {
					width: 104rpx;
					height: 104rpx;
					margin-right: 5rpx;
				}

				&>view:first-child {
					display: flex;
					justify-content: space-between;
					align-items: center;

					.discount {
						font-size: 24rpx;
						margin-left: 5rpx;
					}
				}

				.order-check {
					font-size: 36rpx;
					text-align: center;

					.checkout {
						font-size: 24rpx;
						text-align: center;
					}
				}
			}
		}

		.user-remark-dialog {
			.title {
				padding: 20rpx;
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-size: 32rpx;
				border-bottom: 1rpx solid rgba(0, 0, 0, .1);

				.close {}
			}

			.content {
				padding: 30rpx;

				.tag {
					font-size: 24rpx;
					color: rgba(0, 0, 0, .5);
					margin: 20rpx 0;
				}

				.tag-list {
					text {
						padding: 5rpx 10rpx;
						border: 1rpx solid rgba(0, 0, 0, .2);
						margin: 10rpx;
					}
				}
			}

			.btn {
				background: #d90209;
				font-size: 28rpx;
				color: #fff;
				border-radius: 20rpx;
				margin: 30rpx 20rpx;
				margin-bottom: 60rpx;
				text-align: center;
				padding: 20rpx 0;
			}
		}

		.confirm {
			font-size: 0;
			background-color: #fff;

			&-bg {
				width: 100%;
			}

			&-title {
				font-size: 34rpx;
				color: #fff;

				.circle {
					width: 80rpx;
					height: 80rpx;
					text-align: center;
					line-height: 80rpx;
					background: #fff;
					border: 1rpx solid #d90209;
					border-radius: 100%;
					margin: 10rpx auto;
				}
			}

			&-content {
				text-align: center;
				width: 100%;
				margin-top: -50px;
				position: relative;
				padding: 40rpx;
				padding-top: 0;
			}

			&-address {
				font-size: 26rpx;
				color: rgba(0, 0, 0, .5);
				padding: 20rpx;
				padding-bottom: 40rpx;
				border-bottom: 1px solid rgba(0, 0, 0, .15);

				&>view {
					text-align: center;
					margin-bottom: 20rpx;
				}

				.name {
					font-size: 40rpx;
					color: rgba(0, 0, 0, .9);
					font-weight: 600;
				}
			}

			&-tips {
				color: rgba(0, 0, 0, .5);
				font-size: 24rpx;
				text-align: center;
				padding: 30rpx 0;
				padding-bottom:60rpx;
			}

			&-btn {
				display: flex;
				align-items: center;
				justify-content: space-between;

				&>view {
					color: rgba(0, 0, 0, .9);
					font-size: 28rpx;
					border-radius: 10rpx;
					padding:20rpx 0;
					text-align: center;
					border:1rpx solid  rgba(0, 0, 0, .9);
					width:40%;
				}
				&>view:last-child{
					border:1rpx solid #d90209;
					background-color: #d90209;
					color:#fff;
				}
			}
		}

	}
</style>