<template>
	<view class="page-container uni-column">
		<view class="consultation-container uni-column">
			<view class="title uni-row">咨询</view>
			<view class="info-row uni-row">
				<view class="label">批次号</view>
				<view class="value">{{ daywork.lot_code }}</view>
			</view>
			<view class="info-row uni-row">
				<view class="label">产品描述</view>
				<view class="value">{{ daywork.product_description }}</view>
			</view>
			<view class="info-row uni-column">
				<view class="label" style="margin-bottom: 16rpx;">问题描述</view>
				<view class="value uni-row">
					<textarea v-model="daywork.question"></textarea>
				</view>
			</view>
			<view class="btn uni-row" @click.stop="handleSubmit">提交</view>
		</view>
	</view>
</template>

<script setup>
	import { ref } from 'vue'
	import { onLoad, onReady, onUnload, onShow } from '@dcloudio/uni-app'
	
	const daywork = ref({
		lot_code: 'D35400554012',
		product_description: '电机-254.364.14552',
		question: ''
	})
	
	// 页面生命周期函数
	onLoad(() => {
		
	})
	
	const handleSubmit = () => {
		uni.$emit('addWasteConsultationEvent', {
			question: daywork.value.question
		})
		uni.navigateBack()
	}
</script>

<style lang="scss">
	.page-container {
		height: 100%;
		background-color: #ececec;
		font-size: 28rpx;
		padding: 24rpx;
		box-sizing: border-box;
	}
	.consultation-container {
		background-color: #ffffff;
		padding: 24rpx;
		border-radius: 12rpx;
		
		.title {
			justify-content: center;
			font-size: 32rpx;
			font-weight: 700;
		}
		.info-row {
			margin-top: 24rpx;
			
			.label {
				width: 160rpx;
			}
			.value {
				flex: 1;
				
				textarea {
					flex: 1;
					border: 1px solid #888888;
					box-sizing: border-box;
					padding: 16rpx;
				}
			}
		}
		
		.btn {
			background-color: #00D068;
			color: #ffffff;
			border-radius: 8rpx;
			margin: 24rpx;
			height: 64rpx;
			justify-content: center;
			align-items: center;
		}
	}
</style>