<template>
	<view class="lists">
		<view class="status_bar" :style="navHeight"></view>
		<view class="header-bg">
			<image class="header-bg-img" src="@/static/image/nav_bg@3x.png" mode="scaleToFill"></image>
		</view>
		<view class="main">
			<view class="middle view">
				<view class="text-block">
					<text class="middle-date">银行流水号</text>
					<view class="middle-date-des uni-list picker-year">
						<view class="uni-list-cell">
							<view class="uni-list-cell-db">
								<text class="middle-date-des">H533008256</text>
							</view>
						</view>
					</view>

				</view>
				<view class="text-block">
					<text class="middle-date">收款单位</text>
					<view class="middle-date-des uni-list picker-year">
						<view class="uni-list-cell">
							<view class="uni-list-cell-db">
								<text class="middle-date-des">五粮液</text>
							</view>
						</view>
					</view>
				</view>
				<view class="text-block">
					<text class="middle-date">收款账号</text>
					<text class="middle-date-des">8510050100067259284</text>
				</view>
				<view class="text-block">
					<text class="middle-date">金额</text>
					<text class="middle-date-des">500,000.00</text>
				</view>
				<view class="text-block">
					<text class="middle-date">制票类型</text>
					<view class="middle-date-des uni-list picker-year">
						<view class="uni-list-cell">
							<view class="uni-list-cell-db">
								<picker class="picker-block" @change="bindPickerChange" :value="index" :range="array">
									<text class="uni-input">{{array[index]}}</text>
								</picker>
							</view>
						</view>
						<image class="icon-arrow" src="@/static/image/arrow_r@3x.png" mode=""></image>
					</view>
				</view>
				<view class="text-block text-block-last">
					<text class="middle-date">备注</text>
				</view>
				<view class="remark">
					<textarea class="remark-text" v-model="remark" />
				</view>
			</view>
			<view class="bottom">
				<button class="btn" type="default" @tap="submit">
					<text class="btn-text">确认</text>
				</button>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		mapState
	} from 'vuex'

	export default {
		data() {
			return {
				applyNum: 100,
				remark: '',
				array: ['2021', '2020', '2019', '2018'],
				index: 0,
			}
		},
		computed: {
			...mapState(['sysinfo']),
			navHeight() {
				return {
					'height': `${this.sysinfo.safeArea.top + 44}px`
				}
			},
		},
		methods: {
			bindPickerChange(e) {
				console.log('picker发送选择改变，携带值为', e.detail.value)
				this.index = e.detail.value
			},
			submit() {
				this.$emit('submit')
			},
		}
	}
</script>

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

	.status_bar {
		height: var(--status-bar-height);
	}

	.header-bg {
		height: 284rpx;
		margin-top: -88rpx;
	}

	.header-bg-img {
		width: 750rpx;
	}

	.lists {
		position: relative;
		flex-direction: column;
		background: #f0f4f5;
	}

	.main {
		flex: 1;
		margin: 0 16rpx;
		flex-direction: column;
		background-color: #fff;
		margin-top: -164rpx;
		border-radius: 16rpx;
	}

	.middle {
		background-color: #fff;
		border-radius: 16rpx;
		padding: 32rpx 64rpx 0 48rpx;
	}

	.text-block {
		overflow: hidden;
		height: 96rpx;
		margin-bottom: 14rpx;
		border-bottom: 1px solid #f4f5f6;
	}

	.text-block-last {
		margin-bottom: 0;
		border-bottom: 0;
	}

	.middle-date {
		flex: 2;
		font-size: 28rpx;
		line-height: 96rpx;
		color: #999;
		margin-bottom: 8rpx;
	}

	.middle-date-des {
		flex: 3;
		font-size: 28rpx;
		color: $text-base-color;
		line-height: 96rpx;
	}

	.picker-year {
		position: relative;
		align-items: center;
		padding-left: 14rpx;
	}

	.uni-list-cell {
		flex: 1;
	}

	.uni-list-cell-db {
		flex: 1;
	}

	.picker-block {
		flex: 1;
	}

	.uni-input {
		font-size: 14px;
		color: $text-base-color;
	}

	.icon-arrow {
		position: absolute;
		right: 22rpx;
		top: 40rpx;
		width: 7px;
		height: 10px;
		z-index: 10;
	}

	.remark-text {
		flex: 1;
		height: 320rpx;
		background: #f5f6f7;
		border-radius: 4px;
		padding: 12rpx 18rpx;
	}

	.bottom {
		margin-top: 68rpx;
		padding: 0 16rpx;
		justify-content: center;
	}

	.btn {
		width: 364rpx;
		height: 92rpx;
		margin: 0 auto;
		background: $wly-primary-color;
		border-radius: 46rpx;
	}

	.btn-text {
		color: #fff;
		font-size: 34rpx;
	}

	.btn-text-l {
		color: $wly-primary-color;
	}
</style>
