<template>
	<view class="order view">
		<view class="top">
			<text class="title-no">要货单号：TP10000021</text>
			<view class="title-info">
				<text class="title-info__status">已审批</text>
				<i class="divider"></i>
				<image @click="handleMore" class="icon-more" src="@/static/image/shop_more@3x.png" mode=""></image>
			</view>
		</view>
		<view class="middle view">
			<view class="popover" v-if="ishowMore">
				<image class="popover-img" src="@/static/image/shop_menu@3x.png" mode="aspectFit"></image>
				<view class="popover-box">
					<text class="popover-box-item popover-box-item-1">申请发货</text>
					<text class="popover-box-item" @tap="goHistory">申请历史</text>
				</view>
			</view>
			<view class="middle-trans">
				<text class="middle-title">发货单号：FH200333222 </text>
				<image class="icon_car" src="@/static/image/order_car@3x.png" mode=""></image>
			</view>
			<view class="text-block">
				<text class="middle-date">苏州新川商贸公司</text>
				<text class="middle-date-des">客户名称</text>
			</view>
			<view class="text-block">
				<text class="middle-date middle-billno">2021-08-06 05:14</text>
				<text class="middle-date-des">发票号</text>
			</view>
		</view>
		<view class="bottom view">
			<view class="bottom-nav">
				<view class="bottom-nav-arrow">
					<text class="arrow-des">要货明细</text>
				</view>
			</view>
			<view class="bottom-content">
				<view class="table">
					<view class="table-head">
						<text class="th th-1">产品</text>
						<text class="th">未发货量</text>
						<text class="th">要货数量</text>
						<text class="th">审批量</text>
					</view>
					<view class="row">
						<text class="td td-1">尖庄2101</text>
						<text class="td">75</text>
						<text class="td">25</text>
						<text class="td">10</text>
					</view>
					<view class="row">
						<text class="td td-1">1618五粮液</text>
						<text class="td">100</text>
						<text class="td">25</text>
						<text class="td">60</text>
					</view>
				</view>
				<!-- <uni-table class="bottom-content-table" border emptyText="暂无更多数据">
					<uni-tr>
						<uni-th width='100' align="center">产品</uni-th>
						<uni-th width='70' align="center">未发货量</uni-th>
						<uni-th width='70' align="center">要货数量</uni-th>
						<uni-th width='70' align="center">审批量</uni-th>
					</uni-tr>
					<uni-tr>
						<uni-td>尖庄2101</uni-td>
						<uni-td>75</uni-td>
						<uni-td>25</uni-td>
						<uni-td>10</uni-td>
					</uni-tr>
					<uni-tr>
						<uni-td>1618五粮液</uni-td>
						<uni-td>100</uni-td>
						<uni-td>25</uni-td>
						<uni-td>60</uni-td>
					</uni-tr>
				</uni-table> -->
			</view>
			<view class="bottom-nav">
				<view class="bottom-nav-arrow">
					<text class="arrow-des">收货信息</text>
				</view>
			</view>
			<view class="bottom-content bottom-content-2">
				<view class="text-block">
					<text class="middle-date">TP10000066</text>
					<text class="middle-date-des">要货单号</text>
				</view>
				<view class="text-block">
					<text class="middle-date">一般</text>
					<text class="middle-date-des">重要程度</text>
				</view>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		props: {
			newsItem: {
				type: Object,
				default: function(e) {
					return {}
				}
			}
		},
		data() {
			return {
				ishowMore: false,
				ishowDetail: true
			}
		},
		methods: {
			click() {
				this.$emit('click');
			},
			close(e) {
				e.stopPropagation();
				this.$emit('close');
			},
			handleShowDetail() {
				this.ishowDetail = !this.ishowDetail
			},
			handleMore() {
				this.ishowMore = !this.ishowMore
			},
			goHistory() {
				console.log(1)
				uni.navigateTo({
					url: '/pages/shop/apply-history'
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.view {
		flex-direction: column;
	}

	.order {
		flex: 1;
		background: #ffffff;
		border-radius: 16rpx;
		box-shadow: 0px 2px 4px 0px #dbe4ee;
		margin-bottom: 24rpx;
		margin-top: 18rpx;
	}

	.top {
		height: 72rpx;
		align-items: center;
		justify-content: space-between;
		padding: 0 32rpx;
		border-bottom: 1px solid #f1f2f4;
	}

	.title-no {
		font-size: 24rpx;
		color: #555555;
	}

	.title-info {
		align-items: center;
	}

	.title-info__status {
		font-size: 24rpx;
		color: #999;
	}

	.divider {
		width: 1px;
		height: 28rpx;
		margin-right: 14rpx;
		margin-left: 8rpx;
		border-right: 1px solid rgba(151, 151, 151, 0.39);
	}

	.icon-more {
		width: 16px;
		height: 16px;
	}

	.popover {
		position: absolute;
		right: 20rpx;
		top: 10rpx;
		z-index: 10;
		width: 200rpx;
		box-shadow: 0px 0px 8rpx 0px rgba(0, 0, 0, 0.18);
		background-color: #fff;
		border-radius: 8rpx;
		transition-property: opacity, transform;
		transition-duration: 0.15s;
	}

	.popover-img {
		position: absolute;
		right: 4rpx;
		top: -36rpx;
		z-index: 20;
		width: 48rpx;
		height: 48rpx;
	}

	.popover-box {
		position: relative;
		z-index: 50;
		flex: 1;
		flex-direction: column;
	}

	.popover-box-item {
		text-align: center;
		font-size: 28rpx;
		color: $text-base-color;
		padding: 24rpx 32rpx;
	}

	.popover-box-item-1 {
		border-bottom: 1px solid rgba(151, 151, 151, 0.39);
	}

	.middle {
		position: relative;
		padding: 26rpx 32rpx;
	}
	
	.middle-trans{
		align-items: center;
		height: 60rpx;
		margin-bottom: 32rpx;
	}

	.middle-title {
		font-weight: 500;
		font-size: 32rpx;
		color: $text-base-color;
		font-family: PingFangSC, PingFangSC-Medium;
	}

	.icon_car {
		width: 36rpx;
		height: 36rpx;
		margin-left: 8rpx;
	}

	.text-block {
		flex: 1;
		flex-direction: column;
		margin-bottom: 32rpx;
	}

	.middle-date {
		font-size: 28rpx;
		color: $text-base-color;
		margin-bottom: 8rpx;
	}

	.middle-date-des {
		font-size: 24rpx;
		color: #999;
	}

	.bottom {
		padding: 0 32rpx 64rpx;
	}

	.bottom-nav {
		height: 40rpx;
		justify-content: flex-end;
		align-items: center;
	}

	.bottom-nav-arrow {
		align-items: center;
	}

	.arrow-des {
		font-size: 28rpx;
		color: $text-base-color;
	}

	.bottom-content {
		flex-direction: column;
		margin-top: 16rpx;
		margin-bottom: 40rpx;
	}

	.bottom-content-table {
		flex: 1;
	}

	.uni-table-th {
		background-color: #f5f6f7;
		color: #555;
		font-weight: 400;
		padding: 12rpx 14rpx;
		font-size: 28rpx;
	}

	.uni-table-td {
		text-align: center !important;
	}

	.bottom-content-2 {
		margin-top: 50rpx;
	}

	.table {
		display: table;
		border: 1px solid #ECECEC;
		overflow: hidden;
		border-bottom: 0;
		border-right: 0;
		flex-direction: column;
	}

	.table-head {
		display: table-row;
		height: 64rpx;
	}

	.th {
		display: table-cell;
		background-color: #f5f6f7;
		color: #555;
		text-align: center;
		font-weight: 400;
		padding: 12rpx 14rpx;
		font-size: 28rpx;
		border-right: 1px solid #ECECEC;
		border-bottom: 1px solid #ECECEC;
		width: 142rpx;
	}

	.th-1 {
		width: 228rpx;
	}

	.row {
		display: table-row;
		height: 64rpx;
	}

	.td {
		width: 142rpx;
		padding: 8px 10px;
		font-size: 14px;
		text-align: center;
		display: table-cell;
		color: $text-base-color;
		border-right: 1px solid #ECECEC;
		border-bottom: 1px solid #ECECEC;
	}

	.td-1 {
		width: 228rpx;
	}
</style>
