<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">
								<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 class="middle-date">匿名口令</text>
					<view class="middle-date-des uni-list picker-year">
						<view class="uni-list-cell">
							<view class="uni-list-cell-db">
								<input class="middle-date-des" type="text" v-model="condition.code"
									placeholder="请输入匿名提报口令，后期查询使用" />
							</view>
						</view>
						<image class="icon-arrow icon-search" src="@/static/image/search_b@3x.png" mode=""></image>
					</view>
				</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">细分类型</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 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 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 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 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 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 class="middle-date">终端地址</text>
					<view class="middle-date-des uni-list picker-year">
						<view class="uni-list-cell">
							<view class="uni-list-cell-db">
								<input class="middle-date-des" type="text" v-model="condition.code" placeholder="" />
							</view>
						</view>
						<image class="icon-arrow icon-search" src="@/static/image/search_b@3x.png" mode=""></image>
					</view>
				</view>
				<view class="text-block">
					<text class="middle-date">稽查时间</text>
					<text class="middle-date-des">2022-05-18</text>
				</view>
				<view class="text-block text-block-last">
					<text class="middle-date">稽查说明</text>
				</view>
				<view class="remark">
					<textarea class="remark-text" v-model="condition.remark" />
				</view>

			</view>

			<view class="middle view">
				<view class="text-block">
					<text class="middle-date">物流码</text>
					<input class="middle-date-des" type="text" v-model="condition.code" placeholder="请输入" />
				</view>
				<view class="text-block">
					<text class="middle-date">物流码行项目</text>
					<view class="middle-date-des middle-date-buttons">
						<button class="diy-entry" type="default">
							<image class="diy-icon" src="@/static/image/scan@3x.png" mode="">
							</image>
							<text class="diy-entry-text">扫码</text>
						</button>
						<button class="diy-entry" type="default">
							<image class="diy-icon" src="@/static/image/add@3x.png" mode="">
							</image>
							<text class="diy-entry-text">增加</text>
						</button>
						<button class="diy-entry" type="default">
							<image class="diy-icon" src="@/static/image/del@3x.png" mode="">
							</image>
							<text class="diy-entry-text">删除</text>
						</button>
					</view>
				</view>
			</view>
			<view class="planout-block">
				<button class="btn" type="default">
					<text class="btn-text">查询</text>
				</button>
			</view>

			<view class="middle view planout-block-item">
				<view class="text-block">
					<text class="middle-date">产品名称</text>
					<text class="middle-date-des">300820638</text>
				</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">出库时间</text>
					<text class="middle-date-des">山东省淄博市张店区</text>
				</view>
			</view>

			<view class="middle view planout-block-item">
				<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">
								<input class="middle-date-des" type="text" v-model="condition.code"
									placeholder="请输入收货金额，保留2位小数" />
							</view>
						</view>
					</view>
				</view>
				<view class="text-block no-border">
					<text class="middle-date">事发战区及货源相关信息</text>
					<text class="middle-date-des"></text>
				</view>
				<view class="text-block no-border">
					<text class="middle-date">事发战区</text>
					<text class="middle-date-des">四川营销战区</text>
				</view>
				<view class="text-block no-border">
					<text class="middle-date">事发基地</text>
					<text class="middle-date-des">青蒿基地</text>
				</view>
			</view>

			<view class="middle view">
				<view class="upload-area view">
					<text class="title">门头照片</text>
					<view class="pic-lists">
						<uni-file-picker ref='files' :auto-upload='false' v-model="fileList" file-mediatype="image"
							:imageStyles="imageStyles" @select="select" @progress="progress" @success="success"
							@fail='fail'>
							<text>+</text>
						</uni-file-picker>
					</view>
					<text class="des">(点击图片可放大，只能上传一次图片，多次上传至保留最后上传）</text>
				</view>
				<view class="upload-area view">
					<text class="title">产品照片</text>
					<view class="pic-lists">
						<uni-file-picker ref='files' :auto-upload='false' v-model="fileList" file-mediatype="image"
							:imageStyles="imageStyles" @select="select" @progress="progress" @success="success"
							@fail='fail'>
							<text>+</text>
						</uni-file-picker>
					</view>
					<text class="des">(点击图片可放大，只能上传一次图片，多次上传至保留最后上传）</text>
				</view>
				<view class="upload-area view">
					<text class="title">发票/收据照片</text>
					<view class="pic-lists">
						<uni-file-picker ref='files' :auto-upload='false' v-model="fileList" file-mediatype="image"
							:imageStyles="imageStyles" @select="select" @progress="progress" @success="success"
							@fail='fail'>
							<text>+</text>
						</uni-file-picker>
					</view>
					<text class="des">(点击图片可放大，只能上传一次图片，多次上传至保留最后上传）</text>
				</view>
			</view>


		</view>
		<view class="bottom-area"></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,
				array: ['2021', '2020', '2019', '2018'],
				index: 0,
				condition: {
					code: '',
					remark: '',
				},
				fileList: [],
			}
		},
		computed: {
			...mapState(['sysinfo']),
			navHeight() {
				return {
					'height': `${this.sysinfo.safeArea.top + 44}px`
				}
			},
			imageStyles() {
				return {
					width: 64,
					height: 64,
					border: {
						radius: '10%'
					}
				}
			},
		},
		methods: {
			bindPickerChange(e) {
				console.log('picker发送选择改变，携带值为', e.detail.value)
				this.index = e.detail.value
			},
			submit() {
				this.$emit('submit')
			},
			// 获取上传进度
			progress(e) {
				console.log('上传进度：', e)
			},
			// 选择文件
			select(e) {
				console.log('选择文件：', e, this.fileList)
			},
			// 上传成功
			success(e) {
				console.log('上传成功', e)
			},
			// 上传失败
			fail(e) {
				console.log('上传失败：', e)
			},
		}
	}
</script>

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

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

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

	.header-bg-img {
		width: 100%;
	}

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

	.main {
		position: relative;
		overflow-y: scroll;
		flex-direction: column;
		margin-top: -164rpx;
		border-radius: 16rpx;
		padding: 0 16rpx;
	}

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

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

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

	.no-border {
		border: 0;
	}

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

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

	.middle-date-buttons {}

	.uni-input-placeholder {
		color: #DBDBDB;
	}

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

	.uni-list-cell {
		flex: 1;
		padding-right: 52rpx;
	}

	.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;
	}

	.icon-search {
		width: 11px;
		height: 12px;
		top: 36rpx;
	}

	.remark {
		margin-bottom: 24px;
	}

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


	.diy-entry {
		width: 140rpx;
		height: 68rpx;
		background: #f8f8f8;
		border-radius: 8px;
		line-height: 68rpx;
		border: 1px solid #f8f8f8;
		margin-left: 16rpx;
	}

	.diy-icon {
		width: 24rpx;
		height: 20rpx;
		margin-right: 8rpx;
	}

	.diy-entry-text {
		color: #333;
		font-size: 12px;
	}

	.planout-block-item {
		margin-top: 48rpx;
	}

	.upload-area {
		padding-top: 32rpx;
		padding-bottom: 32rpx;

		.title {
			font-size: 28rpx;
			color: #333;
			font-weight: 500;
		}

		.pic-lists {
			margin-top: 24rpx;
			margin-bottom: 20rpx;
		}

		.des {
			color: #1C84FF;
			font-size: 20rpx;
		}
	}



	.bottom-area {
		height: 140rpx;
		margin-top: 12rpx;
	}

	.bottom {
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 10;
		width: 750rpx;
		height: 140rpx;
		padding: 0 32rpx;
		background-color: #fff;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.btn {
		flex: 1;
		height: 92rpx;
		background: $wly-primary-color;
		border-radius: 46rpx;
	}

	.btn-l {
		margin-right: 30rpx;
		border: 1px solid $wly-primary-color;
		background-color: transparent;

	}

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

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