<template>
	<view class='container'>
		<view style="color: white;font-size: 32rpx;">举报描述</view>
		<view class="wapper mt-30">
			<view class="reason">
				<view>
					<u--textarea class="et-textarea" border="none" v-model="reason" height="260rpx" maxlength="150"
						placeholder="请输入您的描述内容…"></u--textarea>
				</view>
			</view>

			<view class="mt-30 ">
				<view class="control">
					<upload-image v-model="images" maxCount="3" width="100" height="100" type="fullurl"></upload-image>
				</view>
			</view>
		</view>

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

		<!-- 提交 -->
		<u-modal :show="submitShow" @close="submitShow=false" :closeOnClickOverlay="true" :showCancelButton="false" :showConfirmButton="false">
			<view class="flex-column flex-center-center fs-32">
				<view >添加客服微信</view>
				<image class="wh-376 mt-50" src="@/static/logo.png"></image>
			</view>
		</u-modal>
		<!-- <wskj-modal :show="submitShow" :showCancelButton="false"
      :showConfirmButton="false">
			
			<view solt="confirmButton"></view>
		</wskj-modal> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				reason: '',
				submitShow: false,
				images: '',
			};
		},
		onLoad() {
			this.images = '/assets/img/qrcode.png'
		},
		methods: {
			onSubmit() {
				// console.log(this.images)
				// this.images = ''
				// console.log(this.images)
				// 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 {
		width: 100%;
		height: 100%;
		padding: 30rpx;
		background: #0F0F0F;
	}

	.wapper {
		background: rgba(255, 255, 255, 0.04);
		border-radius: 20rpx;
		padding: 10rpx;
	}

	.reason {}

	.et-textarea {
		background: transparent;
		border-radius: 20rpx;
		color: #FFF;
	}

	.reason>.title {}

	.reason>textarea {
		margin-top: 20rpx;
		padding: 15rpx;
		width: 100% !important;
		border: 1px solid #ccc !important;
	}

	.control {
		margin: 20rpx;
	}

	.btn {
		width: 94%;
		height: 96rpx;
		text-align: center;
		line-height: 96rpx;
		position: absolute;
		bottom: 100rpx;
		left: 50%;
		margin-left: -47%;
		background-color: #9FFF00;
		color: #000;
		font-size: 32rpx;
		border-radius: 50rpx;
	}
</style>