<template>
	<!-- 记工记账 -->
	<view class="page">
		<navbar title="记工" 
		bgColor="#F9FEFE"
		leftClick @leftClick="$utils.navigateBack" />
		
		<uv-cell
		title="选择日期"
		rightIconStyle="fontSize: 30rpx;"
		:value="form.date || '请选择选择日期'"
		@click="$refs.datetimePicker.open()"
		isLink
		></uv-cell>
		
		<view class="form-sheet-cell">
			<view class="label">
				上班时间
			</view>
			<!-- <input placeholder="请输入上班时间" 
			type="number"
			v-model="form.phone" /> -->
			
			<uv-number-box v-model="form.time"
			:step="0.5"
			:min="0.5"
			></uv-number-box>
		</view>
		
		<view class="form-sheet-cell">
			<view class="label">
				备注
			</view>
			<uv-textarea
			v-model="form.workDetail" 
			count 
			:maxlength="300" 
			autoHeight
			placeholder="请输入备注"></uv-textarea>
		</view>
		
		<view class="uni-color-btn"
		@click="submit">
			确认
		</view>
		
		<uv-datetime-picker 
		ref="datetimePicker" 
		mode="date" 
		v-model="dateValue"
		@confirm="datetimePickerConfim"/>
		
	</view>
</template>

<script>
	import mixinList from '@/mixins/list.js'
	export default {
		mixins : [mixinList],
		data() {
			return {
				form : {
					date : '',
					time : 0.5,
				},
				id : 0,
				dateValue : new Date().getTime()
			}
		},
		onLoad({id}) {
			this.id = id
		},
		onShow() {},
		methods: {
			datetimePickerConfim(e){
				this.form.date = this.$dayjs(e.value).format('YYYY-MM-DD')
			},
			submit(){
				
			},
		}
	}
</script>

<style scoped lang="scss">
	.page {
		background-color: #fff;
		
		.form-sheet-cell{
			display: flex;
			background-color: #fff;
			padding: 20rpx 30rpx;
			align-items: center;
			.label{
				width: 160rpx;
			}
			.price{
				display: flex;
				text-align: center;
				input{
					width: 150rpx;
					border: 1px solid $uni-color;
					margin: 0 10rpx;
				}
			}
			input{
				flex: 1;
				background-color: rgba($uni-color, 0.1);
				padding: 10rpx 20rpx;
				border-radius: 10rpx;
			}
			.right-icon{
				margin-left: auto;
			}
		}
		/deep/ .uv-textarea{
			background-color: rgba($uni-color, 0.1) !important;
			min-height: 400rpx;
		}
	}
</style>