<template>
	<view class='container'>
		<view style="background: linear-gradient( 180deg, #1FCA7C 0%, #1FCAA7 100%);">
			<u-navbar :autoBack="true" placeholder="true" :title="title" bgColor="transparent" leftIconColor="#FFF"
				:title-style="{color: '#FFF'}">
			</u-navbar>
		</view>
		<view class="mar-20">
			<view class="flex-column-center">
				<image class="w-20 h-20" style="background-color: #1FCA7C;"></image>
				<text>利达国宾中心</text>
			</view>
			<view class="flex-column-center fs-32 fw-700  mt-30">
				<image class="w-10 h-40 mr-15" style="background-color: #1FCA7C;"></image>
				<text>业主信息</text>
			</view>
			<view class="flex-column br-12 fs-28 mt-30" style="box-shadow: 0px 0px 15px 1px rgba(142,142,142,0.16);">
				<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
					<text style="color: #999999;">业主姓名</text>
					<text>张三</text>
				</view>
				<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
					<text style="color: #999999;">业主房间号</text>
					<text>张三</text>
				</view>
				<view class="flex-row-between pad-30" style="border-bottom: 1rpx solid #E9E9E9;">
					<text style="color: #999999;">业主手机号</text>
					<text>张三</text>
				</view>
			</view>
			<view class="flex-column-center fs-32 fw-700  mt-30">
				<image class="w-10 h-40 mr-15" style="background-color: #1FCA7C;"></image>
				<text>报修信息</text>
			</view>
			<view class="flex-column br-12 fs-28 mt-30 pad-30"
				style="box-shadow: 0px 0px 15px 1px rgba(142,142,142,0.16);">
				<u--textarea v-model="reason" height="260rpx" maxlength="100" placeholder="填写下详细报修内容，有助于工作人员快速帮您解决问题"
					count border="border"></u--textarea>
				<view class="mt-30">
					<upload-image v-model="images" maxCount="3" width="70" height="70" type="fullurl"></upload-image>
				</view>
			</view>

		</view>
		<view @click="onSubmit" class="fullscreen-btn">
			<text>提交</text>
		</view>

		<!-- 提交 -->
		<wskj-modal :show="submitShow" :showCancelButton="true" confirmText="确定" confirmColor="#EB7318"
			@close="submitShow = false" @confirm="onConfirmSubmit" @cancel="submitShow = false">
			<view class="pt-40 pb-40">
				<view>
					<text class="fs-28">确认提交？</text>
				</view>
			</view>
		</wskj-modal>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: '居家报修',
				type: 0,
				reason: '',
				submitShow: false,
				images: '',
			};
		},
		onLoad(e) {
			this.type = e.type
			if (e.type == 0) {
				this.title = "居家报修"
			} else {
				this.title = "公区报事"
			}
		},
		methods: {
			onSubmit() {
				this.$wskj.to("/pagesMain/pages/tjsq?type=" + this.type)
				// if (!this.reason) {
				// 	return this.$u.toast('请输入内容')
				// }
				// if (!this.images) {
				// 	return this.$u.toast('请至少上传一张照片')
				// }
				// if (this.reason.length < 10) {
				// 	return this.$u.toast('文字描述最低10个字')
				// }
				// this.submitShow = true
			},
			// 提交
			onConfirmSubmit() {
				// const params = {
				// 	url: '/api/user/yijian',
				// 	loadingTip: '',
				// 	data: {
				// 		content: this.reason,
				// 		images: this.images
				// 	}
				// }
				// // console.log(params);
				// this.$request(params).then(res => {
				// 	// console.log(res)
				// 	this.submitShow = false
				// 	if (res.code === 1) {
				// 		this.$u.toast(res.msg || '提交成功')

				// 		this.reason = ''
				// 		this.images = ''
				// 	} else {
				// 		this.$u.toast(res.msg || '提交失败')
				// 	}
				// }).catch(err => {
				// 	this.submitShow = false
				// 	this.$u.toast(err.msg || '提交失败')
				// })
			}
		},
	};
</script>

<style scoped>
	.container {
		display: flex;
		flex-direction: column;
		background: #fff;
	}
</style>